Commit 98293222 by seldaek

Removed a couple of @-operator calls to file_get_contents

git-svn-id: svn://dwoo.org/dwoo/trunk@303 0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent cf39726d
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
* Fixed a property reading bug on objects that implemented __get but not * Fixed a property reading bug on objects that implemented __get but not
__isset, implementing __isset is however very much recommended __isset, implementing __isset is however very much recommended
* Fixed a bug when accessing global vars from a sub-template * Fixed a bug when accessing global vars from a sub-template
* Removed a couple of @-operator calls to file_get_contents
[2009-07-18] 1.1.0 [2009-07-18] 1.1.0
! BC Break: Dwoo::initGlobals() is only called once during the Dwoo object ! BC Break: Dwoo::initGlobals() is only called once during the Dwoo object
......
...@@ -48,11 +48,12 @@ class Dwoo_Loader implements Dwoo_ILoader ...@@ -48,11 +48,12 @@ class Dwoo_Loader implements Dwoo_ILoader
$this->cacheDir = rtrim($cacheDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; $this->cacheDir = rtrim($cacheDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
// include class paths or rebuild paths if the cache file isn't there // include class paths or rebuild paths if the cache file isn't there
$foo = @file_get_contents($this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); $cacheFile = $this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php';
if ($foo) { if (file_exists($cacheFile)) {
$this->classPath = unserialize($foo) + $this->classPath; $classpath = file_get_contents($cacheFile);
$this->classPath = unserialize($classpath) + $this->classPath;
} else { } else {
$this->rebuildClassPathCache($this->corePluginDir, $this->cacheDir.'classpath.cache.d'.Dwoo::RELEASE_TAG.'.php'); $this->rebuildClassPathCache($this->corePluginDir, $cacheFile);
} }
} }
...@@ -136,9 +137,9 @@ class Dwoo_Loader implements Dwoo_ILoader ...@@ -136,9 +137,9 @@ class Dwoo_Loader implements Dwoo_ILoader
} }
$cacheFile = $this->cacheDir . 'classpath-'.substr(strtr($pluginDir, '/\\:'.PATH_SEPARATOR, '----'), strlen($pluginDir) > 80 ? -80 : 0).'.d'.Dwoo::RELEASE_TAG.'.php'; $cacheFile = $this->cacheDir . 'classpath-'.substr(strtr($pluginDir, '/\\:'.PATH_SEPARATOR, '----'), strlen($pluginDir) > 80 ? -80 : 0).'.d'.Dwoo::RELEASE_TAG.'.php';
$this->paths[$pluginDir] = $cacheFile; $this->paths[$pluginDir] = $cacheFile;
$foo = @file_get_contents($cacheFile); if (file_exists($cacheFile)) {
if ($foo) { $classpath = file_get_contents($cacheFile);
$this->classPath = unserialize($foo) + $this->classPath; $this->classPath = unserialize($classpath) + $this->classPath;
} else { } else {
$this->rebuildClassPathCache($pluginDir, $cacheFile); $this->rebuildClassPathCache($pluginDir, $cacheFile);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment