本文整理匯總了PHP中DatabaseManager::Configuration方法的典型用法代碼示例。如果您正苦於以下問題:PHP DatabaseManager::Configuration方法的具體用法?PHP DatabaseManager::Configuration怎麽用?PHP DatabaseManager::Configuration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DatabaseManager
的用法示例。
在下文中一共展示了DatabaseManager::Configuration方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dbConfig
/**
* You can override this to provide custom database connection setting
* @returns \jf\DatabaseSetting
*/
function dbConfig()
{
if (self::$config === null) {
$dbConfig = DatabaseManager::Configuration();
$newConfig = new \jf\DatabaseSetting($dbConfig->Adapter, $dbConfig->DatabaseName, $dbConfig->Username, $dbConfig->Password, $dbConfig->Host, $dbConfig->TablePrefix . "_test_");
self::$config = $newConfig;
}
return self::$config;
}
示例2: ResetAssignments
/**
* Remove all role-permission relations
* mostly used for testing
*
* @param boolean $Ensure
* must set or throws error
* @return number of deleted relations
*/
function ResetAssignments($Ensure = false)
{
if ($Ensure !== true) {
throw new \Exception("You must pass true to this function, otherwise it won't work.");
return;
}
$res = jf::SQL("DELETE FROM {$this->TablePrefix()}rbac_rolepermissions");
$Adapter = DatabaseManager::Configuration()->Adapter;
if ($Adapter == "mysqli" or $Adapter == "pdo_mysql") {
jf::SQL("ALTER TABLE {$this->TablePrefix()}rbac_rolepermissions AUTO_INCREMENT =1 ");
} elseif ($Adapter == "pdo_sqlite") {
jf::SQL("delete from sqlite_sequence where name=? ", $this->TablePrefix() . "_rbac_rolepermissions");
} else {
throw new \Exception("RBAC can not reset table on this type of database: {$Adapter}");
}
$this->Assign("root", "root");
return $res;
}
示例3: TablePrefix
static function TablePrefix()
{
return DatabaseManager::Configuration()->TablePrefix;
}