original_string: protected function rebuildClassPathCache($path, $cacheFile)
  	{
  		if ($cacheFile!==false) {
  			$tmp = $this->classPath;
  			$this->classPath = array();
  		}
  
  		// iterates over all files/folders
  		$list = glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*');
  		if (is_array($list)) {
  			foreach ($list as $f) {
  				if (is_dir($f)) {
  					$this->rebuildClassPathCache($f, false);
  				} else {
  					$this->classPath[str_replace(array('function.','block.','modifier.','outputfilter.','filter.','prefilter.','postfilter.','pre.','post.','output.','shared.','helper.'), '', basename($f, '.php'))] = $f;
  				}
  			}
  		}
  
  		// save in file if it's the first call (not recursed)
  		if ($cacheFile!==false) {
  			if (!file_put_contents($cacheFile, serialize($this->classPath))) {
  				throw new Dwoo_Exception('Could not write into '.$cacheFile.', either because the folder is not there (create it) or because of the chmod configuration (please ensure this directory is writable by php), alternatively you can change the directory used with $dwoo->setCompileDir() or provide a custom loader object with $dwoo->setLoader()');
  			}
  			$this->classPath += $tmp;
  		}
  	}
code: protected function rebuildClassPathCache($path, $cacheFile)
  	{
  		if ($cacheFile!==false) {
  			$tmp = $this->classPath;
  			$this->classPath = array();
  		}
  
  		// iterates over all files/folders
  		$list = glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*');
  		if (is_array($list)) {
  			foreach ($list as $f) {
  				if (is_dir($f)) {
  					$this->rebuildClassPathCache($f, false);
  				} else {
  					$this->classPath[str_replace(array('function.','block.','modifier.','outputfilter.','filter.','prefilter.','postfilter.','pre.','post.','output.','shared.','helper.'), '', basename($f, '.php'))] = $f;
  				}
  			}
  		}
  
  		// save in file if it's the first call (not recursed)
  		if ($cacheFile!==false) {
  			if (!file_put_contents($cacheFile, serialize($this->classPath))) {
  				throw new Dwoo_Exception('Could not write into '.$cacheFile.', either because the folder is not there (create it) or because of the chmod configuration (please ensure this directory is writable by php), alternatively you can change the directory used with $dwoo->setCompileDir() or provide a custom loader object with $dwoo->setLoader()');
  			}
  			$this->classPath += $tmp;
  		}
  	}
code_tokens: protected function rebuildClassPathCache ( $ path , $ cacheFile ) { if ( $ cacheFile !== false ) { $ tmp = $ this -> classPath ; $ this -> classPath = array ( ) ; } // iterates over all files/folders $ list = glob ( rtrim ( $ path , DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR . '*' ) ; if ( is_array ( $ list ) ) { foreach ( $ list as $ f ) { if ( is_dir ( $ f ) ) { $ this -> rebuildClassPathCache ( $ f , false ) ; } else { $ this -> classPath [ str_replace ( array ( 'function.' , 'block.' , 'modifier.' , 'outputfilter.' , 'filter.' , 'prefilter.' , 'postfilter.' , 'pre.' , 'post.' , 'output.' , 'shared.' , 'helper.' ) , '' , basename ( $ f , '.php' ) ) ] = $ f ; } } } // save in file if it's the first call (not recursed) if ( $ cacheFile !== false ) { if ( ! file_put_contents ( $ cacheFile , serialize ( $ this -> classPath ) ) ) { throw new Dwoo_Exception ( 'Could not write into ' . $ cacheFile . ', either because the folder is not there (create it) or because of the chmod configuration (please ensure this directory is writable by php), alternatively you can change the directory used with $dwoo->setCompileDir() or provide a custom loader object with $dwoo->setLoader()' ) ; } $ this -> classPath += $ tmp ; } }
docstring: rebuilds class paths, scans the given directory recursively and saves all paths in the given file
  
  @param string $path the plugin path to scan
  @param string $cacheFile the file where to store the plugin paths cache, it will be overwritten
docstring_tokens: rebuilds class paths scans the given directory recursively and saves all paths in the given file