Skip to content

Commit

Permalink
Merge pull request #4 from mtudor/hotfix/error-if-glob-returns-false
Browse files Browse the repository at this point in the history
On some systems, glob() will return false if no files were found.
  • Loading branch information
mtudor committed Nov 4, 2013
2 parents c4950ee + bd72593 commit 1b9c71a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/TccAbstractModule/Module/AbstractModuleNoTraits.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public function getConfig()
GLOB_BRACE
);

// glob() returns false on error. On some systems, glob() will return false (instead of an empty array) if no
// files are found. Treat both in the same way - no config will be loaded.
$configFiles = $configFiles ?: array();

$config = array();
foreach ($configFiles as $configFile) {
$config = ArrayUtils::merge($config, include $configFile);
Expand All @@ -95,6 +99,10 @@ public function getControllerConfig()
GLOB_BRACE
);

// glob() returns false on error. On some systems, glob() will return false (instead of an empty array) if no
// files are found. Treat both in the same way - no config will be loaded.
$configFiles = $configFiles ?: array();

$config = array();
foreach ($configFiles as $configFile) {
$config = ArrayUtils::merge($config, include $configFile);
Expand All @@ -115,6 +123,10 @@ public function getServiceConfig()
GLOB_BRACE
);

// glob() returns false on error. On some systems, glob() will return false (instead of an empty array) if no
// files are found. Treat both in the same way - no config will be loaded.
$configFiles = $configFiles ?: array();

$config = array();
foreach ($configFiles as $configFile) {
$config = ArrayUtils::merge($config, include $configFile);
Expand All @@ -135,6 +147,10 @@ public function getViewHelperConfig()
GLOB_BRACE
);

// glob() returns false on error. On some systems, glob() will return false (instead of an empty array) if no
// files are found. Treat both in the same way - no config will be loaded.
$configFiles = $configFiles ?: array();

$config = array();
foreach ($configFiles as $configFile) {
$config = ArrayUtils::merge($config, include $configFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ public function getConfig()
GLOB_BRACE
);

// glob() returns false on error. On some systems, glob() will return false (instead of an empty array) if no
// files are found. Treat both in the same way - no config will be loaded.
$configFiles = $configFiles ?: array();

$config = array();
foreach ($configFiles as $configFile) {
$config = ArrayUtils::merge($config, include $configFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public function getControllerConfig()
GLOB_BRACE
);

// glob() returns false on error. On some systems, glob() will return false (instead of an empty array) if no
// files are found. Treat both in the same way - no config will be loaded.
$configFiles = $configFiles ?: array();

$config = array();
foreach ($configFiles as $configFile) {
$config = ArrayUtils::merge($config, include $configFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public function getServiceConfig()
GLOB_BRACE
);

// glob() returns false on error. On some systems, glob() will return false (instead of an empty array) if no
// files are found. Treat both in the same way - no config will be loaded.
$configFiles = $configFiles ?: array();

$config = array();
foreach ($configFiles as $configFile) {
$config = ArrayUtils::merge($config, include $configFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public function getViewHelperConfig()
GLOB_BRACE
);

// glob() returns false on error. On some systems, glob() will return false (instead of an empty array) if no
// files are found. Treat both in the same way - no config will be loaded.
$configFiles = $configFiles ?: array();

$config = array();
foreach ($configFiles as $configFile) {
$config = ArrayUtils::merge($config, include $configFile);
Expand Down

0 comments on commit 1b9c71a

Please sign in to comment.