src/core/framework/core/3rdparty/dwoo/Dwoo.php
public function addResource($name, $class, $compilerFactory = null)
	{
		if (strlen($name) < 2) {
			throw new Dwoo_Exception('Resource names must be at least two-character long to avoid conflicts with Windows paths');
		}

		if (!class_exists($class)) {
			throw new Dwoo_Exception('Resource class does not exist');
		}

		$interfaces = class_implements($class);
		if (in_array('Dwoo_ITemplate', $interfaces) === false) {
			throw new Dwoo_Exception('Resource class must implement Dwoo_ITemplate');
		}

		$this->resources[$name] = array('class'=>$class, 'compiler'=>$compilerFactory);
	}
public function addResource($name, $class, $compilerFactory = null)
	{
		if (strlen($name) < 2) {
			throw new Dwoo_Exception('Resource names must be at least two-character long to avoid conflicts with Windows paths');
		}

		if (!class_exists($class)) {
			throw new Dwoo_Exception('Resource class does not exist');
		}

		$interfaces = class_implements($class);
		if (in_array('Dwoo_ITemplate', $interfaces) === false) {
			throw new Dwoo_Exception('Resource class must implement Dwoo_ITemplate');
		}

		$this->resources[$name] = array('class'=>$class, 'compiler'=>$compilerFactory);
	}
public function addResource ( $ name , $ class , $ compilerFactory = null ) { if ( strlen ( $ name ) < 2 ) { throw new Dwoo_Exception ( 'Resource names must be at least two-character long to avoid conflicts with Windows paths' ) ; } if ( ! class_exists ( $ class ) ) { throw new Dwoo_Exception ( 'Resource class does not exist' ) ; } $ interfaces = class_implements ( $ class ) ; if ( in_array ( 'Dwoo_ITemplate' , $ interfaces ) === false ) { throw new Dwoo_Exception ( 'Resource class must implement Dwoo_ITemplate' ) ; } $ this -> resources [ $ name ] = array ( 'class' => $ class , 'compiler' => $ compilerFactory ) ; }
adds a resource or overrides a default one

@param string $name the resource name
@param string $class the resource class (which must implement Dwoo_ITemplate)
@param callback $compilerFactory the compiler factory callback, a function that must return a compiler instance used to compile this resource, if none is provided. by default it will produce a Dwoo_Compiler object
adds a resource or overrides a default one