当前位置: 首页>>代码示例>>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;未经允许,请勿转载。