Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Commit

Permalink
Only use cached class path in constructor if really an array
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffmanns committed Apr 18, 2018
1 parent 751beca commit d87f96c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/Dwoo/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,19 @@ public function __construct($cacheDir)

// include class paths or rebuild paths if the cache file isn't there
$cacheFile = $this->cacheDir . 'classpath.cache.d' . Core::RELEASE_TAG . '.php';

$chachedClassPath = null;

if (file_exists($cacheFile)) {
$classpath = file_get_contents($cacheFile);
$this->classPath = unserialize($classpath) + $this->classPath;
} else {

$chachedClassPath = unserialize(file_get_contents($cacheFile));

if (is_array($chachedClassPath)) {
$this->classPath = $chachedClassPath + $this->classPath;
}
}

if (!is_array($chachedClassPath)) {
$this->rebuildClassPathCache($this->corePluginDir, $cacheFile);
}
}
Expand Down

0 comments on commit d87f96c

Please sign in to comment.