fix glob error in bundle class.
This commit is contained in:
@@ -271,10 +271,6 @@ class Bundle {
|
||||
/**
|
||||
* Detect all of the existing bundles in the application.
|
||||
*
|
||||
* The names of the bundles are cached so this operation will be only be
|
||||
* performed once and then the same array will be returned on each later
|
||||
* request for the bundle names.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function all()
|
||||
@@ -283,9 +279,17 @@ class Bundle {
|
||||
|
||||
$bundles = array();
|
||||
|
||||
foreach (array_filter(glob(BUNDLE_PATH.'*'), 'is_dir') as $bundle)
|
||||
$files = glob(BUNDLE_PATH.'*');
|
||||
|
||||
// When open_basedir is enabled the glob function returns false on
|
||||
// an empty array. We'll check for this and return an empty array
|
||||
// if the bundle directory doesn't have any bundles.
|
||||
if ($files !== false)
|
||||
{
|
||||
$bundles[] = basename($bundle);
|
||||
foreach (array_filter($files, 'is_dir') as $bundle)
|
||||
{
|
||||
$bundles[] = basename($bundle);
|
||||
}
|
||||
}
|
||||
|
||||
return static::$bundles = $bundles;
|
||||
|
||||
Reference in New Issue
Block a user