本文整理匯總了PHP中TPL::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP TPL::__construct方法的具體用法?PHP TPL::__construct怎麽用?PHP TPL::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TPL
的用法示例。
在下文中一共展示了TPL::__construct方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct(S $databaseIndex = NULL)
{
parent::__construct();
// Do the rest ...
if (!TheFactoryMethodOfSingleton::checkHasInstance(__CLASS__)) {
// Set execution time for SQLHandler;
self::setExeTime(new S(__CLASS__));
// Make a default databaseIndex ...
switch ($databaseIndex == NULL) {
case TRUE:
// Yes, we set the default ...
$databaseIndex = new S('db_0');
break;
}
# Set ALL object properties to some defaults ...
self::$objSQLH = new S($GLOBALS['H'][$databaseIndex->toString()]);
self::$objSQLU = new S($GLOBALS['U'][$databaseIndex->toString()]);
self::$objSQLP = new S($GLOBALS['P'][$databaseIndex->toString()]);
self::$objSQLD = new S($GLOBALS['D'][$databaseIndex->toString()]);
self::$objSQLR = new S($GLOBALS['R'][$databaseIndex->toString()]);
// Use a switch, to clean the code;
if (SQL_PERSISTENT_CONNECTION == 1) {
// Do return ...
return (mysql_pconnect(self::$objSQLH, self::$objSQLU, self::$objSQLP) or self::renderSQLScreenOfDeath()) && (mysql_select_db(self::$objSQLD) or self::renderSQLScreenOfDeath());
} else {
// Do return ...
return (mysql_connect(self::$objSQLH, self::$objSQLU, self::$objSQLP) or self::renderSQLScreenOfDeath()) && (mysql_select_db(self::$objSQLD) or self::renderSQLScreenOfDeath());
}
} else {
// Return the instantiated object;
return TheFactoryMethodOfSingleton::getInstance(__CLASS__);
}
}