fuel / oil

Fuel PHP Framework - Fuel v1.x Oil command-line package
http://fuelphp.com/docs/packages/oil/intro.html
106 stars 67 forks source link

Fix 'Unable to read existing migrations' error on PHP 5.2.5 or later. #174

Closed hokamoto closed 11 years ago

hokamoto commented 11 years ago

scafold : Error: Unable to read existing migrations. Do you have an 'open_basedir' defined? http://fuelphp.com/forums/discussion/10303/scafold-error-unable-to-read-existing-migrations-do-you-have-an-039open_basedir039-defined

glob() returns FALSE instead of an empty array since PHP 5.2.5 when wildcard is used in the argument and the directory is empty.

Backward Incompatible Changes http://www.php.net/manual/en/migration52.incompatible.php

Signed-off-by: Hideki Okamoto tox2ro@gmail.com

WanWizard commented 11 years ago

The bug has been fixed: http://git.php.net/?p=php-src.git;a=commit;h=2fb7cd30c59345838588ba89ad8b05cc4c34d6dd

WanWizard commented 11 years ago

@FrenkyNet can I have your thoughts on this? It looks overly complex to me...

WanWizard commented 11 years ago

p.s. if we're going to add a workaround for this bug, I'd rather add a function ourglob() to base.php, and use that throughout the framework. We currently have 9 classes using glob(), so if this needs fixing, then not only in this file.

frankdejonge commented 11 years ago

@WanWizard I agree, I doubt this needs to be this complex. The hidden dir stuff will never happen for sure, so the array filter is not needed, all we need to do it store the glob in a var and perform an if empty() check on that, which will cover both false and empty array.