Closed kasimi closed 5 years ago
A naive solution would be to check for in_array('language', $dirs)
. It's unlikely that there's a second migrations
folder somewhere in the extension, but a language
folder could exist for example in styles/all
, although there shouldn't be any PHP files in there. We would also have to assume that there's neither a vendor nor an extension name equal to language
or migrations
.
Fixed in #84
Affected lines:
$dir
is an array that usually looks like this:['vendor', 'extname', 'language']
.end($dir)
returnslanguage
which makes thetryLoadFile()
method successfully return aLangFile
instance. However, a language file located invendor/extname/language/sub/lang.php
has a$dir
of['vendor', 'extname', 'language', 'sub']
.end($dir)
returnssub
, resulting in a genericPHPFile
instance to be returned. Similar problem for migration files.At the moment I'm not sure how to fix this in a way that works locally as well as in production. Locally, the
vendor/extname
is missing, so$dir
is just['language']
and['language', 'sub']
, respectively. Any ideas?