當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DatabaseManager::Configuration方法代碼示例

本文整理匯總了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;
 }
開發者ID:michalkoczwara,項目名稱:WebGoatPHP,代碼行數:13,代碼來源:test.php

示例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;
 }
開發者ID:michalkoczwara,項目名稱:WebGoatPHP,代碼行數:26,代碼來源:base.php

示例3: TablePrefix

 static function TablePrefix()
 {
     return DatabaseManager::Configuration()->TablePrefix;
 }
開發者ID:michalkoczwara,項目名稱:WebGoatPHP,代碼行數:4,代碼來源:j.php


注:本文中的DatabaseManager::Configuration方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。