Exemple #1
0
 function resolveFilePath($filename)
 {
     $path = $filename;
     if (file_exists($path)) {
         return $path;
     }
     $sequence = self::$nsLoadPath;
     if ($sequence) {
         foreach ($sequence as $pathTemplate) {
             $pathMap = self::createMap($pathTemplate);
             foreach ($pathMap as $pathSegment) {
                 $path = self::createPath($pathSegment, $path, $filename);
                 if (($hash = One_Script_Cache::inCache($path)) || file_exists($path)) {
                     return $path;
                 }
             }
         }
     }
     return false;
 }
Exemple #2
0
 public function parse($load, $filename, $path = "")
 {
     list($cached, $codeOrPath, $actualPath) = $load;
     if ($cached) {
         //				echo ' (in cache)';
         if ($codeOrPath instanceof One_Script_Node_Root) {
             $this->rootNode = $codeOrPath;
         } else {
             $this->rootNode = One_Script_Cache::get($codeOrPath);
         }
     } else {
         //				echo ' (NOT in cache )';
         $parser = new One_Script_Parser($this);
         $this->rootNode = $parser->parse($codeOrPath, $filename, $path, $actualPath);
         One_Script_Cache::cache($actualPath, $this->rootNode);
     }
     if ($this->rootNode->isError()) {
         $this->error = $this->rootNode->error;
     }
 }