/** * getInstance * * @return void */ public function getInstance() { if (!is_object(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }
public function __construct($app_dir, $app_env = null) { parent::__construct(); $this->config->application->set("folders/root", $app_dir); $this->config->application->loadConfig($app_env); // set library include path $this->setIncludePath($this->config->application->get("folders/library")); // set controller include path $this->setIncludePath($this->config->application->get("folders/controller")); $this->router = Joy_Router::getInstance(); // Bootstrap Loader... $bootstrap = $this->config->application->get("application/bootstrap"); if ($bootstrap) { $ref = new Joy_Reflection($bootstrap); $object = $ref->newInstance(); } if (!$object instanceof Joy_Application_Bootstrap) { $object = new Joy_Application_Bootstrap(); } }