* @license PHP License * @package Wombat * @subpackage base */ /** * Instance creator * * Functor to encapsulate new operator * * @version 0.3.0 * @package Wombat * @subpackage base */ class WBClass_Creator_WBResponse extends WBClass_Creator { /** * Keep current instance * * @var array */ static private $instance; /** * Return Object * * Response is singleton * * @return object */ public function instantiate( $parameter = array() ) { if (!empty(self::$instance)) { return self::$instance; } // select module if (empty($parameter['module'])) { $parameter['module'] = 'Http'; } $clazz = 'WBResponse_' . $parameter['module']; WBClass::load($clazz); self::$instance = new $clazz; return self::$instance; } }