本文整理匯總了PHP中DBManagerFactory::getTypeInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBManagerFactory::getTypeInstance方法的具體用法?PHP DBManagerFactory::getTypeInstance怎麽用?PHP DBManagerFactory::getTypeInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBManagerFactory
的用法示例。
在下文中一共展示了DBManagerFactory::getTypeInstance方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: validate_systemOptions
function validate_systemOptions()
{
global $mod_strings;
$errors = array();
if (!empty($_SESSION['setup_db_type']) && trim($_SESSION['setup_db_type']) != '') {
$db = DBManagerFactory::getTypeInstance($_SESSION['setup_db_type']);
if (!empty($db)) {
$_SESSION['setup_db_manager'] = get_class($db);
return $errors;
}
}
$errors[] = "<span class='error'>" . $mod_strings['ERR_DB_INVALID'] . "</span>";
return $errors;
}
示例2: isValidDBName
/**
* isValidDBName
*
* Utility to perform the check during install to ensure a database name entered by the user
* is valid based on the type of database server
* @param string $name Proposed name for the DB
* @param string $dbType Type of database server
* @return bool true or false based on the validity of the DB name
*/
function isValidDBName($name, $dbType)
{
$db = DBManagerFactory::getTypeInstance($dbType);
return $db->isDatabaseNameValid($name);
}