예제 #1
0
 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
예제 #2
0
 /**
  * @return Bootstrap
  */
 public static function singleton()
 {
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 /**
  * Singleton
  * If instance of class doesn't exist, autoload application models and create new instance of class
  * If instance of class does exist, return instance
  * @return object
  */
 public static function singleton()
 {
     if (!isset(self::$instance)) {
         foreach (glob("application/models/*.php") as $filename) {
             include $filename;
         }
         $className = __CLASS__;
         self::$instance = new $className();
     }
     return self::$instance;
 }
예제 #4
0
 public static function getInstance()
 {
     if (empty(self::$instance)) {
         self::$instance = new Bootstrap();
     }
     return self::$instance;
 }
예제 #5
0
<?php

include "../core/Bootstrap.php";
Bootstrap::instance();