Closed MightyPork closed 10 years ago
@MightyPork Hi, can you give me your environment configuration (PHP version, OS) ? Your PHP version must be upper than 5.3.
Can you execute this long PHP command inside php artisan tinker
and send me the result, please ?
var_dump(array_merge(File::glob(base_path().'/vendor/*/*/app/assets/*/'), [base_path().'/app/assets/images',base_path().'/app/assets/javascripts',base_path().'/app/assets/stylesheets',base_path().'/lib/assets/images',base_path().'/lib/assets/javascripts',base_path().'/lib/assets/stylesheets',base_path().'/vendor/assets/images',base_path().'/vendor/assets/javascripts',base_path().'/vendor/assets/stylesheets',]));
And do you have tweak the config.php
file of this package ?
FYI, I've successfully install this package on Windows 7 and Ubuntu 12.04 with PHP 5.5.x
@tortuetorche Why, yes, here you go:
[8] *> var_dump(array_merge(File::glob(base_path().'/vendor/*/*/app/assets/*/'), [base_path().'/app/assets/images',base_path().'/app/assets/javascripts',base_path().'/app/assets/stylesheets',base_path().'/lib/assets/images',base_path().'/lib/assets/javascripts',base_path().'/lib/assets/stylesheets',base_path().'/vendor/assets/images',base_path().'/vendor/assets/javascripts',base_path().'/vendor/assets/stylesheets',]));
PHP Warning: array_merge(): Argument #1 is not an array in /srv/webroot/vendor/d11wtq/boris/lib/Boris/EvalWorker.php(133) : eval()'d code on line 18
NULL
// NULL
[9] > var_dump(File::glob(base_path().'/vendor/*/*/app/assets/*/'));
bool(false)
// NULL
[10] > phpversion();
// '5.5.14'
I have ArchBang, 64bit, version Qt2 2014. PHP version as you can see above.
Hope this helps you fix it.
Thank you, so the error is here:
File::glob(base_path().'/vendor/*/*/app/assets/*/');
Can you try to run these two PHP commands, and send me the result please?
var_dump(File::glob(base_path()));
var_dump(glob(base_path()));
Maybe it's a PHP config issue or a permission issue on your file-system...
Can you try this: For just getting start with Laravel, I just do these following steps:
sudo chmod -R 770 /your/path/to/laravel/folder/
Then add www-data
group to your Laravel application
sudo chgrp -R www-data /your/path/to/laravel/folder/
Here:
> echo base_path();
/srv/webroot[10]
> var_dump(File::glob(base_path()));
array(1) {
[0]=>
string(12) "/srv/webroot"
}
// NULL
> print_r(File::glob(base_path()));
Array
(
[0] => /srv/webroot
)
// true
> var_dump(glob(base_path()));
array(1) {
[0]=>
string(12) "/srv/webroot"
}
// NULL
Also,
/srv$ ls -l
total 12
dr-xr-xr-x 2 root ftp 4096 Jun 4 16:39 ftp
drwxrwxrwx 2 root root 4096 Jul 7 00:41 http
drwxr-xr-x 11 ondra users 4096 Jul 15 23:19 webroot
/srv/webroot$ ls -l
total 168
drwxr-xr-x 13 ondra users 4096 Jul 14 12:15 app
drwxr-xr-x 2 ondra users 4096 Jul 7 01:45 bootstrap
drwxr-xr-x 7 ondra users 4096 Jul 15 22:27 bower_components
drwxr-xr-x 9 ondra users 4096 Jul 15 22:58 node_modules
drwxr-xr-x 3 ondra users 4096 Jul 14 12:15 provider
drwxr-xr-x 31 ondra users 4096 Jul 15 22:26 vendor
drwxr-xr-x 6 ondra users 4096 Jul 15 23:12 www
-rwxr-xr-x 1 ondra users 2452 Jun 1 20:16 artisan
-rw-r--r-- 1 ondra users 174 Jul 15 22:27 bower.json
-rw-r--r-- 1 ondra users 1842 Jul 15 23:15 composer.json
-rw-r--r-- 1 ondra users 110454 Jul 15 22:26 composer.lock
-rw-r--r-- 1 ondra users 1733 Jul 15 23:15 Gruntfile.js
-rw-r--r-- 1 ondra users 361 Jul 15 22:58 package.json
-rw-r--r-- 1 ondra users 567 Jun 1 20:16 phpunit.xml
-rw-r--r-- 1 ondra users 519 Jun 1 20:16 server.php
-rwxr-xr-x 1 ondra users 343 Jul 15 23:19 update_all
Not sure what's wrong, but something apparently is.
Oh, by the way, this works:
> var_dump(glob(base_path()."/*"));
array(16) {
[0]=>
string(25) "/srv/webroot/Gruntfile.js"
[1]=>
string(16) "/srv/webroot/app"
[2]=>
string(20) "/srv/webroot/artisan"
[3]=>
string(22) "/srv/webroot/bootstrap"
[4]=>
string(23) "/srv/webroot/bower.json"
[5]=>
string(29) "/srv/webroot/bower_components"
[6]=>
string(26) "/srv/webroot/composer.json"
[7]=>
string(26) "/srv/webroot/composer.lock"
[8]=>
string(25) "/srv/webroot/node_modules"
[9]=>
string(25) "/srv/webroot/package.json"
[10]=>
string(24) "/srv/webroot/phpunit.xml"
[11]=>
string(21) "/srv/webroot/provider"
[12]=>
string(23) "/srv/webroot/server.php"
[13]=>
string(23) "/srv/webroot/update_all"
[14]=>
string(19) "/srv/webroot/vendor"
[15]=>
string(16) "/srv/webroot/www"
}
Can you try this command line, to return a PHP error instead of false
:
var_dump(File::glob(base_path().'/vendor/*/*/app/assets/*/', GLOB_ERR));
@tortuetorche You just get FALSE:
> var_dump(File::glob(base_path().'/vendor/*/*/app/assets/*/', GLOB_ERR));
bool(false)
// NULL
And this one:
var_dump(File::glob(base_path().'/vendor/*/*/app/assets/*'));
Well, there is no matching file.
> var_dump(File::glob(base_path().'/vendor/*/*/app/assets/*'));
bool(false)
// NULL
Then I made one such file to try it:
> var_dump(File::glob(base_path().'/vendor/*/*/app/assets/*'));
array(1) {
[0]=>
string(42) "/srv/webroot/vendor/a/a/app/assets/foo.bar"
}
// NULL
On my computer it returns an empty array instead of false
...
Can you try this last PHP command, please ?
var_dump(File::glob(base_path().'/vendor/*/*/app/assets/*', GLOB_ONLYDIR));
Yep, here goes
// trying yours
[19] > var_dump(File::glob(base_path().'/vendor/*/*/app/assets/*', GLOB_ONLYDIR));
bool(false)
// NULL
// without
[20] > var_dump(File::glob(base_path().'/vendor/*/*/app/assets/*'));
array(1) {
[0]=>
string(42) "/srv/webroot/vendor/a/a/app/assets/foo.bar"
}
// NULL
// without the /*
[21] > var_dump(File::glob(base_path().'/vendor/*/*/app/assets', GLOB_ONLYDIR));
array(1) {
[0]=>
string(34) "/srv/webroot/vendor/a/a/app/assets"
}
// NULL
Btw, if it helps, here is my phpinfo: http://pastebin.com/FBJYjG2E
Maybe you can just try glob with the /*
at the end, and if it is false, use array()
instead.
After Googling on this issue, it appears that glob()
returns false
on some PHP installs.
I think I can make a helper function to return an empty array if glob()
returns false
.
Thank you for your collaboration Ondřej. I'll push a fix as soon as possible.
alright,. no problem. Well, I've already replaced this with Grunt, but it'll help others with similar issue.
@MightyPork If you can confirm that this issue is gone, it'll be very helpful.
Have a good day.
Ok I will try, write when it's fixed.
I tried to install this to Laravel, following the steps in the readme, but Composer gives me this error:
I'm not sure what to make of it. It looked like this might finally be an asset pipeline that will work, but I was mistaken, it seems.