At the moment I have:
$files = array_merge(
glob($path_ . '*.js'),
glob($path_ . '*.css'));
If the directories are empty on windows it returns an empty array. If they are empty on linux nothing is returned.
This produces this error on linux: Warning: array_merge() [function.array-merge]: Argument #1 is not an array
After some further research and testing I found that it is a bug in PHP: https://bugs.php.net/bug.php?id=53460
From http://php.net/manual/en/function.glob.php:
Returns an array containing the matched files/directories, an empty array if no file matched or FALSE on error.
Check if glob($path_ . '*.js') === FALSE
on linux. In this case, there is probably a permission error or something like this. It should be an empty array if there is no error, as the documentation suggests.
Also check for the case in your files/directory. Windows is case insensitive, that could explain a difference between windows and linux.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With