本文整理汇总了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);
}