public static function app() { if (self::$_app === NULL) { self::$_app = new DooWebApp(); } return self::$_app; }
/** * @return DooWebApp the application singleton, auto create if the singleton has not been created yet. */ public static function app() { if (self::$_app === NULL) { self::loadCore('app/DooWebApp'); self::$_app = new DooWebApp(); } return self::$_app; }
/** * @param string $appType The type of application you want. Options are: 'DooWebApp' and 'DooCliApp' * @return DooWebApp|DooCliApp the application singleton, auto create if the singleton has not been created yet. */ public static function app($appType = 'DooWebApp') { if (self::$_app === NULL) { if ($appType !== 'DooWebApp') { self::loadCore('app/' . $appType); } self::$_app = new $appType(); } return self::$_app; }
/** * Set application type to be created. * @param string|object $type 'DooWebApp' or pass in any instance of your custom app class */ public static function setAppType($type) { if (is_string($type)) { self::loadCore('app/' . $type); self::$_app = new $type(); } else { self::$_app = $type; } }