code/libraries/joomlatools/library/template/engine/factory.php
public function registerEngine($identifier, array $config = array())
    {
        $result = false;

        $identifier = $this->getIdentifier($identifier);
        $class      = $this->getObject('manager')->getClass($identifier);

        if(!$class || !array_key_exists('KTemplateEngineInterface', class_implements($class)))
        {
            throw new UnexpectedValueException(
                'Engine: '.$identifier.' does not implement KTemplateEngineInterface'
            );
        }

        $types = call_user_func(array($class, 'getFileTypes'));/*$class::getFileTypes();*/

        if (!empty($types))
        {
            foreach($types as $type)
            {
                if(!$this->isRegistered($type))
                {
                    $identifier->getConfig()->merge($config)->append(array(
                        'debug'      => $this->getConfig()->debug,
                        'cache'      => $this->getConfig()->cache,
                        'cache_path' => $this->getConfig()->cache_path
                    ));

                    $this->__engines[$type] = $identifier;
                }
            }
        }

        return $result;
    }
public function registerEngine($identifier, array $config = array())
    {
        $result = false;

        $identifier = $this->getIdentifier($identifier);
        $class      = $this->getObject('manager')->getClass($identifier);

        if(!$class || !array_key_exists('KTemplateEngineInterface', class_implements($class)))
        {
            throw new UnexpectedValueException(
                'Engine: '.$identifier.' does not implement KTemplateEngineInterface'
            );
        }

        $types = call_user_func(array($class, 'getFileTypes'));/*$class::getFileTypes();*/

        if (!empty($types))
        {
            foreach($types as $type)
            {
                if(!$this->isRegistered($type))
                {
                    $identifier->getConfig()->merge($config)->append(array(
                        'debug'      => $this->getConfig()->debug,
                        'cache'      => $this->getConfig()->cache,
                        'cache_path' => $this->getConfig()->cache_path
                    ));

                    $this->__engines[$type] = $identifier;
                }
            }
        }

        return $result;
    }
public function registerEngine ( $ identifier , array $ config = array ( ) ) { $ result = false ; $ identifier = $ this -> getIdentifier ( $ identifier ) ; $ class = $ this -> getObject ( 'manager' ) -> getClass ( $ identifier ) ; if ( ! $ class || ! array_key_exists ( 'KTemplateEngineInterface' , class_implements ( $ class ) ) ) { throw new UnexpectedValueException ( 'Engine: ' . $ identifier . ' does not implement KTemplateEngineInterface' ) ; } $ types = call_user_func ( array ( $ class , 'getFileTypes' ) ) ; /*$class::getFileTypes();*/ if ( ! empty ( $ types ) ) { foreach ( $ types as $ type ) { if ( ! $ this -> isRegistered ( $ type ) ) { $ identifier -> getConfig ( ) -> merge ( $ config ) -> append ( array ( 'debug' => $ this -> getConfig ( ) -> debug , 'cache' => $ this -> getConfig ( ) -> cache , 'cache_path' => $ this -> getConfig ( ) -> cache_path ) ) ; $ this -> __engines [ $ type ] = $ identifier ; } } } return $ result ; }
Register an engine

Function prevents from registering the engine twice

@param string $identifier A engine identifier string
@param  array $config  An optional associative array of configuration options
@throws UnexpectedValueException
@return bool Returns TRUE on success, FALSE on failure.
Register an engine