diff options
author | robocoder <anthon.pang@gmail.com> | 2010-07-30 08:53:39 +0400 |
---|---|---|
committer | robocoder <anthon.pang@gmail.com> | 2010-07-30 08:53:39 +0400 |
commit | e2a5b4b5e1fda1c09cfffbf999dc1504c8b8c27b (patch) | |
tree | 6c2ef986ca3eb8c56007754d0a0a8e1d10a7b568 /core | |
parent | 4536608d2dd752d464e9bd3e1be0a694ba0642c5 (diff) |
quick fixes #1529 - recovers more gracefully if glob() is disabled; installer can be run, and it will provide a warning.
Piwik will continue to run albeit in a crippled state:
- can't change language via selection list
- can't list/activate/deactivate plugins
- can't run updates
git-svn-id: http://dev.piwik.org/svn/trunk@2814 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core')
-rw-r--r-- | core/AssetManager.php | 4 | ||||
-rw-r--r-- | core/Piwik.php | 4 | ||||
-rw-r--r-- | core/PluginsManager.php | 4 | ||||
-rw-r--r-- | core/Updater.php | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/core/AssetManager.php b/core/AssetManager.php index eddf147446..03cf94eed4 100644 --- a/core/AssetManager.php +++ b/core/AssetManager.php @@ -368,9 +368,9 @@ class Piwik_AssetManager { $mergedFileDirectory = self::getMergedFileDirectory(); - $matchingFiles = glob( $mergedFileDirectory . "*." . $type ); + $matchingFiles = @glob( $mergedFileDirectory . "*." . $type ); - if($matchingFiles === false) + if($matchingFiles == false) { return false; } diff --git a/core/Piwik.php b/core/Piwik.php index 64228e0d4a..0fa26b26ba 100644 --- a/core/Piwik.php +++ b/core/Piwik.php @@ -229,11 +229,11 @@ class Piwik */ public static function globr($sDir, $sPattern, $nFlags = NULL) { - if(($aFiles = glob("$sDir/$sPattern", $nFlags)) == false) + if(($aFiles = @glob("$sDir/$sPattern", $nFlags)) == false) { $aFiles = array(); } - if(($aDirs = glob("$sDir/*", GLOB_ONLYDIR)) != false) + if(($aDirs = @glob("$sDir/*", GLOB_ONLYDIR)) != false) { foreach ($aDirs as $sSubDir) { diff --git a/core/PluginsManager.php b/core/PluginsManager.php index ae06ab05c9..a9a5342da5 100644 --- a/core/PluginsManager.php +++ b/core/PluginsManager.php @@ -98,8 +98,8 @@ class Piwik_PluginsManager */ public function readPluginsDirectory() { - $pluginsName = glob( PIWIK_INCLUDE_PATH . '/plugins/*', GLOB_ONLYDIR); - $pluginsName = $pluginsName === false ? array() : array_map('basename', $pluginsName); + $pluginsName = @glob( PIWIK_INCLUDE_PATH . '/plugins/*', GLOB_ONLYDIR); + $pluginsName = $pluginsName == false ? array() : array_map('basename', $pluginsName); return $pluginsName; } diff --git a/core/Updater.php b/core/Updater.php index 69756fa14a..6325cb53e8 100644 --- a/core/Updater.php +++ b/core/Updater.php @@ -194,8 +194,8 @@ class Piwik_Updater $pathToUpdates = sprintf($this->pathUpdateFilePlugins, $name) . '*.php'; } - $files = glob( $pathToUpdates ); - if($files === false) + $files = @glob( $pathToUpdates ); + if($files == false) { $files = array(); } |