本文整理汇总了PHP中Connect::prod_connection方法的典型用法代码示例。如果您正苦于以下问题:PHP Connect::prod_connection方法的具体用法?PHP Connect::prod_connection怎么用?PHP Connect::prod_connection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connect
的用法示例。
在下文中一共展示了Connect::prod_connection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($database = 'sys')
{
//Connect is the Class with all db connections and connections details
$con = new Connect();
//if local level
if (DOMAINAME != 'speedemployer') {
switch ($database) {
default:
$this->_db = new PDO("sqlite:" . SQLITE . $database . ".db");
break;
case 'sys':
if ($con->local_connection() != false) {
$this->_db = $con->local_connection();
} else {
$this->_db = new PDO("sqlite:" . SQLITE . $database . ".db");
}
break;
case 'mys':
$this->_db = $con->local_connection2();
break;
}
//if production level
} else {
switch ($database) {
default:
$this->_db = new PDO("sqlite:" . SQLITE . $database . ".db");
break;
case 'sys':
$server = SUBDOMAIN != 'test' ? $con->prod_connection() : $con->dev_connection();
if ($server != false) {
$this->_db = $con->prod_connection();
} else {
$this->_db = new PDO("sqlite:" . SQLITE . $database . ".db");
}
break;
}
}
}