public static function getInstance() { if (is_null(self::$instance)) { self::$instance = new self(); } return self::$instance; }
public static function getInstance($db_host, $db_name, $db_pass, $db_database, $conn, $code) { if (!isset(self::$instance)) { self::$instance = new mysql($db_host, $db_name, $db_pass, $db_database, $conn, $code); } return self::$instance; }
public static function get_instance() { if (self::$instance == null) { self::$instance = new self(); } return self::$instance; }
public static function getInstance() { if (self::$instance == NULL) { self::$instance = new self(); } return self::$instance; }
/** * [getIns 获取单例] * @return [type] [description] */ public static function getDbIns() { if (self::$instance instanceof self) { return self::$instance; } return self::$instance = new self(); }
public static function i($connection = '') { if (!isset(self::$instance)) { list($host, $user, $pass, $db) = explode(':', $connection); self::$instance = new mysql(); self::$instance->connect($host, $user, $pass, $db); } return self::$instance; }
/** * 单例模式 */ public static function getInstance($params) { if (!self::$instance) { self::$instance = new self($params); } return self::$instance; }