示例#1
0
文件: config.php 项目: naozone/phx
 public static function getInstance(array $arr)
 {
     if (!self::$_instance instanceof Config) {
         self::$_instance = new Config($arr);
     }
     return self::$_instance;
 }
示例#2
0
 /**
  * Singleton pattern
  *
  * @return  Config
  */
 public static function instance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
示例#3
0
 public static function Instance()
 {
     if (!self::$_instance instanceof self) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
示例#4
0
 static function getInstance()
 {
     if (self::$_instance == null) {
         self::$_instance = new Config();
     }
     return self::$_instance;
 }
示例#5
0
 /**
  * getInstance
  * @return Config
  */
 public static function getInstance()
 {
     if (NULL === self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
示例#6
0
 public static function getInstance()
 {
     if (self::$_instance === null) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
示例#7
0
 public static function init()
 {
     if (self::$_instance == null) {
         self::$_instance = new Config();
     }
     return self::$_instance;
 }
示例#8
0
 public static function get()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new Config();
     }
     return self::$_instance;
 }
示例#9
0
文件: config.php 项目: laiello/ko3
 /**
  * Get the singleton instance of Config.
  *
  *     $config = Config::instance();
  *
  * @return  Config
  */
 public static function instance()
 {
     if (Config::$_instance === NULL) {
         // Create a new instance
         Config::$_instance = new Config();
     }
     return Config::$_instance;
 }
示例#10
0
 /**
  * Gets the singleton instance.
  * @return Config
  */
 public static function &instance()
 {
     if (self::$_instance === null) {
         // Create a new instance
         self::$_instance = new self();
     }
     return self::$_instance;
 }
示例#11
0
 /**
  * Get the singleton instance of Config.
  *
  * @return  Config
  */
 public static function instance(Config_Reader $reader, $first = TRUE)
 {
     if (self::$_instance === NULL) {
         // Create a new instance
         self::$_instance = new self();
     }
     self::$_instance->attach($reader, $first);
     return self::$_instance;
 }
示例#12
0
 /**
  * Setup the instance (singleton)
  *
  * @param $glob array Current globals
  *
  * @return Config
  */
 public static function getInstance($glob = array())
 {
     if (!self::$_instance instanceof self) {
         self::$_instance = new self($glob);
     }
     return self::$_instance;
 }
示例#13
0
文件: Config.php 项目: kstep/pnut
 public function unserialize($serialized)
 {
     $this->_config = unserialize($serialized);
     self::$_instance = $this;
 }