本文整理汇总了PHP中DBConnector::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP DBConnector::instance方法的具体用法?PHP DBConnector::instance怎么用?PHP DBConnector::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBConnector
的用法示例。
在下文中一共展示了DBConnector::instance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
/**
* returns an instance of a sqlite connection
*
* @return instance of this class
*/
public static function getInstance()
{
if (null === self::$instance) {
self::$instance = new SQLite3(self::$dbfile);
}
return self::$instance;
}
示例2: getInstance
public static function getInstance($dbDetails = null)
{
if ($dbDetails == null) {
$dbDetails = array('db_name' => 'ant_web', 'db_host' => 'localhost', 'db_user' => 'root', 'db_pass' => 'root');
}
// Check if instance already exists
if (self::$instance == null) {
self::$instance = new DBConnector($dbDetails);
}
return self::$instance;
}
示例3: getInstance
public static function getInstance($dbDetails = null)
{
if ($dbDetails == null) {
//keith's home computer localhost:8889 root root
//jonathan's home computer localhost:8888 root
$dbDetails = array('db_name' => 'photo4130', 'db_host' => 'localhost:8888', 'db_user' => 'root', 'db_pass' => '');
}
// Check if instance already exists
if (self::$instance == null) {
self::$instance = new DBConnector($dbDetails);
}
return self::$instance;
}