当前位置: 首页>>代码示例>>PHP>>正文


PHP IDatabase::getType方法代码示例

本文整理汇总了PHP中IDatabase::getType方法的典型用法代码示例。如果您正苦于以下问题:PHP IDatabase::getType方法的具体用法?PHP IDatabase::getType怎么用?PHP IDatabase::getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDatabase的用法示例。


在下文中一共展示了IDatabase::getType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * @param array $params An associative array with one member:
  *   - connection: An IDatabase connection object
  */
 public function __construct(array $params)
 {
     if (!isset($params['connection'])) {
         throw new InvalidArgumentException("Missing 'connection' argument.");
     }
     $this->db = $params['connection'];
     parent::__construct(['servers' => [['type' => $this->db->getType(), 'host' => $this->db->getServer(), 'dbname' => $this->db->getDBname(), 'load' => 1]], 'trxProfiler' => isset($params['trxProfiler']) ? $params['trxProfiler'] : null, 'srvCache' => isset($params['srvCache']) ? $params['srvCache'] : null, 'wanCache' => isset($params['wanCache']) ? $params['wanCache'] : null]);
     if (isset($params['readOnlyReason'])) {
         $this->db->setLBInfo('readOnlyReason', $params['readOnlyReason']);
     }
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:15,代码来源:LoadBalancerSingle.php

示例2: getSearchEngineClass

 /**
  * @param IDatabase $db
  * @return string SearchEngine subclass name
  * @since 1.28
  */
 public static function getSearchEngineClass(IDatabase $db)
 {
     switch ($db->getType()) {
         case 'sqlite':
             return 'SearchSqlite';
         case 'mysql':
             return 'SearchMySQL';
         case 'postgres':
             return 'SearchPostgres';
         case 'mssql':
             return 'SearchMssql';
         case 'oracle':
             return 'SearchOracle';
         default:
             return 'SearchEngineDummy';
     }
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:22,代码来源:SearchEngineFactory.php

示例3: patchPath

 /**
  * Get the full path of a patch file. Originally based on archive()
  * from updaters.inc. Keep in mind this always returns a patch, as
  * it fails back to MySQL if no DB-specific patch can be found
  *
  * @param IDatabase $db
  * @param string $patch The name of the patch, like patch-something.sql
  * @return string Full path to patch file
  */
 public function patchPath(IDatabase $db, $patch)
 {
     global $IP;
     $dbType = $db->getType();
     if (file_exists("{$IP}/maintenance/{$dbType}/archives/{$patch}")) {
         return "{$IP}/maintenance/{$dbType}/archives/{$patch}";
     } else {
         return "{$IP}/maintenance/archives/{$patch}";
     }
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:19,代码来源:DatabaseUpdater.php

示例4: getSqlFilePath

 /**
  * Return a path to the DBMS-specific SQL file if it exists,
  * otherwise default SQL file
  *
  * @param IDatabase $db
  * @param string $filename
  * @return string
  */
 private function getSqlFilePath($db, $filename)
 {
     global $IP;
     $dbmsSpecificFilePath = "{$IP}/maintenance/" . $db->getType() . "/{$filename}";
     if (file_exists($dbmsSpecificFilePath)) {
         return $dbmsSpecificFilePath;
     } else {
         return "{$IP}/maintenance/{$filename}";
     }
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:18,代码来源:DatabaseInstaller.php


注:本文中的IDatabase::getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。