Esempio n. 1
0
 /**
  * @return Bootstrap
  */
 public static function factory()
 {
     if (!is_null(self::$_instance)) {
         return self::$_instance;
     }
     return self::$_instance = new self();
 }
Esempio n. 2
0
 public static function getInstance()
 {
     if (!self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Esempio n. 3
0
 public static function instance()
 {
     if (self::$_instance === false) {
         self::$_instance = new Bootstrap();
     }
     return self::$_instance;
 }
Esempio n. 4
0
 /**
  * @return Bootstrap
  * @since 2.1.0
  */
 public static function getBooster()
 {
     if (null === self::$_instance) {
         // Lets find inside current module
         $module = Yii::app()->getController()->getModule();
         if ($module) {
             if ($module->hasComponent('bootstrap')) {
                 self::$_instance = $module->getComponent('bootstrap');
             }
         }
         // Still nothing?
         if (null === self::$_instance) {
             if (Yii::app()->hasComponent('bootstrap')) {
                 self::$_instance = Yii::app()->getComponent('bootstrap');
             }
         }
     }
     return self::$_instance;
 }