Ejemplo n.º 1
0
 public static function singleton()
 {
     if (self::$instance == null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Ejemplo n.º 2
0
 /**
  * Crée et retourne l'objet SPDO
  *
  * @access public
  * @static
  * @param void
  * @return SPDO $instance
  */
 public static function getInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new SPDO();
     }
     return self::$instance;
 }
Ejemplo n.º 3
0
 public static function singleton()
 {
     if (self::$instance == null) {
         $config = Config::singleton();
         if ($config->get('dbname') != '' or $config->get('dbuser') != '') {
             self::$instance = new self();
         } else {
             return false;
         }
     }
     return self::$instance;
 }