original_string: protected function getEngine()
  	{
  		if($this->dwoo) {
  			return $this->dwoo;
  		}
  
  		if(!class_exists('Dwoo')) {
  			if (file_exists(dirname(__FILE__).'/../../../dwooAutoload.php')) {
  				// file was dropped with the entire dwoo package
  				require dirname(__FILE__).'/../../../dwooAutoload.php';
  			} else {
  				// assume the dwoo package is in the include path
  				require 'dwooAutoload.php';
  			}
  		}
  
  		$parentMode = fileperms(AgaviConfig::get('core.cache_dir'));
  
  		$compileDir = AgaviConfig::get('core.cache_dir') . DIRECTORY_SEPARATOR . self::COMPILE_DIR . DIRECTORY_SEPARATOR . self::COMPILE_SUBDIR;
  		AgaviToolkit::mkdir($compileDir, $parentMode, true);
  
  		$cacheDir = AgaviConfig::get('core.cache_dir') . DIRECTORY_SEPARATOR . self::CACHE_DIR;
  		AgaviToolkit::mkdir($cacheDir, $parentMode, true);
  
  		$this->dwoo = new Dwoo($compileDir, $cacheDir);
  
  		if (!empty($this->plugin_dir)) {
  			$this->dwoo->getLoader()->addDirectory($this->plugin_dir);
  		}
  
  		$this->dwoo->setDefaultCompilerFactory('file', array($this, 'compilerFactory'));
  
  		return $this->dwoo;
  	}
code: protected function getEngine()
  	{
  		if($this->dwoo) {
  			return $this->dwoo;
  		}
  
  		if(!class_exists('Dwoo')) {
  			if (file_exists(dirname(__FILE__).'/../../../dwooAutoload.php')) {
  				// file was dropped with the entire dwoo package
  				require dirname(__FILE__).'/../../../dwooAutoload.php';
  			} else {
  				// assume the dwoo package is in the include path
  				require 'dwooAutoload.php';
  			}
  		}
  
  		$parentMode = fileperms(AgaviConfig::get('core.cache_dir'));
  
  		$compileDir = AgaviConfig::get('core.cache_dir') . DIRECTORY_SEPARATOR . self::COMPILE_DIR . DIRECTORY_SEPARATOR . self::COMPILE_SUBDIR;
  		AgaviToolkit::mkdir($compileDir, $parentMode, true);
  
  		$cacheDir = AgaviConfig::get('core.cache_dir') . DIRECTORY_SEPARATOR . self::CACHE_DIR;
  		AgaviToolkit::mkdir($cacheDir, $parentMode, true);
  
  		$this->dwoo = new Dwoo($compileDir, $cacheDir);
  
  		if (!empty($this->plugin_dir)) {
  			$this->dwoo->getLoader()->addDirectory($this->plugin_dir);
  		}
  
  		$this->dwoo->setDefaultCompilerFactory('file', array($this, 'compilerFactory'));
  
  		return $this->dwoo;
  	}
code_tokens: protected function getEngine ( ) { if ( $ this -> dwoo ) { return $ this -> dwoo ; } if ( ! class_exists ( 'Dwoo' ) ) { if ( file_exists ( dirname ( __FILE__ ) . '/../../../dwooAutoload.php' ) ) { // file was dropped with the entire dwoo package require dirname ( __FILE__ ) . '/../../../dwooAutoload.php' ; } else { // assume the dwoo package is in the include path require 'dwooAutoload.php' ; } } $ parentMode = fileperms ( AgaviConfig :: get ( 'core.cache_dir' ) ) ; $ compileDir = AgaviConfig :: get ( 'core.cache_dir' ) . DIRECTORY_SEPARATOR . self :: COMPILE_DIR . DIRECTORY_SEPARATOR . self :: COMPILE_SUBDIR ; AgaviToolkit :: mkdir ( $ compileDir , $ parentMode , true ) ; $ cacheDir = AgaviConfig :: get ( 'core.cache_dir' ) . DIRECTORY_SEPARATOR . self :: CACHE_DIR ; AgaviToolkit :: mkdir ( $ cacheDir , $ parentMode , true ) ; $ this -> dwoo = new Dwoo ( $ compileDir , $ cacheDir ) ; if ( ! empty ( $ this -> plugin_dir ) ) { $ this -> dwoo -> getLoader ( ) -> addDirectory ( $ this -> plugin_dir ) ; } $ this -> dwoo -> setDefaultCompilerFactory ( 'file' , array ( $ this , 'compilerFactory' ) ) ; return $ this -> dwoo ; }
docstring: Grab a cleaned up dwoo instance.
  
  @return     Dwoo A Dwoo instance.
docstring_tokens: Grab a cleaned up dwoo instance .