public static function app()
 {
     if (self::$_app === NULL) {
         self::$_app = new DooWebApp();
     }
     return self::$_app;
 }
Пример #2
0
 /**
  * @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;
 }
Пример #3
0
 /**
  * @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;
 }
Пример #4
0
 /**
  * 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;
     }
 }