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