/**
  * Constructor, take Core object as param
  * @param Core $core
  */
 public function __construct(Core $core)
 {
     $this->core = $core;
     $this->corePluginDir = Core::DWOO_DIRECTORY . DIRECTORY_SEPARATOR . 'Plugins';
     $this->cacheDir = rtrim($core->getCompileDir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
     // include class paths or rebuild paths if the cache file isn't there
     $cacheFile = $this->cacheDir . 'classpath.cache.d' . Core::RELEASE_TAG . '.php';
     if (file_exists($cacheFile)) {
         $classpath = file_get_contents($cacheFile);
         $this->classPath = unserialize($classpath) + $this->classPath;
     } else {
         $this->rebuildClassPathCache($this->corePluginDir, $cacheFile);
     }
 }
Exemplo n.º 2
0
 /**
  * returns the full compiled file name and assigns a default value to it if
  * required
  *
  * @param Core $dwoo the dwoo instance that requests the file name
  *
  * @return string the full path to the compiled file
  */
 protected function getCompiledFilename(Core $dwoo)
 {
     // no compile id was provided, set default
     if ($this->compileId === null) {
         $this->compileId = str_replace('../', '__', strtr($this->getResourceIdentifier(), '\\:', '/-'));
     }
     return $dwoo->getCompileDir() . $this->compileId . '.d' . Core::RELEASE_TAG . '.php';
 }
Exemplo n.º 3
0
 /**
  * returns the full compiled file name and assigns a default value to it if
  * required
  *
  * @param Core $dwoo the dwoo instance that requests the file name
  *
  * @return string the full path to the compiled file
  */
 protected function getCompiledFilename(Core $dwoo)
 {
     // no compile id was provided, set default
     if ($this->compileId === null) {
         $this->compileId = $this->name;
     }
     return $dwoo->getCompileDir() . $this->compileId . '.d' . Core::RELEASE_TAG . '.php';
 }