| // +----------------------------------------------------------------------+ // // $Id$ require_once 'Var_Dump/Renderer/Common.php'; /** * A loader class for the renderers. * * @package Var_Dump * @category PHP * @author Frederic Poeydomenge */ class Var_Dump_Renderer { /** * Attempt to return a concrete Var_Dump_Renderer instance. * * @param string $mode Name of the renderer. * @param array $options Parameters for the rendering. * @access public */ function & factory($mode, $options) { @include_once 'Var_Dump/Renderer/' . $mode . '.php'; $className = 'Var_Dump_Renderer_' . $mode; if (class_exists($className)) { $obj = new $className($options); } else { include_once 'PEAR.php'; PEAR::raiseError('Var_Dump: renderer "' . $mode . '" not found', TRUE); return NULL; } return $obj; } } ?>