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


PHP DatabaseBase::clearFlag方法代码示例

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


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

示例1: insertUpdateRow

	/**
	 * Helper function: Add a key to the updatelog table
	 * Obviously, only use this for updates that occur after the updatelog table was
	 * created!
	 * @param string $key Name of key to insert
	 * @param string $val [optional] value to insert along with the key
	 */
	public function insertUpdateRow( $key, $val = null ) {
		$this->db->clearFlag( DBO_DDLMODE );
		$values = array( 'ul_key' => $key );
		if ( $val && $this->canUseNewUpdatelog() ) {
			$values['ul_value'] = $val;
		}
		$this->db->insert( 'updatelog', $values, __METHOD__, 'IGNORE' );
		$this->db->setFlag( DBO_DDLMODE );
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:16,代码来源:DatabaseUpdater.php

示例2: getMasterDB

 /**
  * Get a master connection to the logging DB
  *
  * @return DatabaseBase
  * @throws DBError
  */
 protected function getMasterDB()
 {
     if (!$this->dbw) {
         // Get a separate connection in autocommit mode
         $lb = wfGetLBFactory()->newMainLB();
         $this->dbw = $lb->getConnection(DB_MASTER, array(), $this->wiki);
         $this->dbw->clearFlag(DBO_TRX);
     }
     return $this->dbw;
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:16,代码来源:DBFileJournal.php

示例3: getConnection

 /**
  * Connect to the database using the administrative user/password currently
  * defined in the session. Returns a status object. On success, the status
  * object will contain a Database object in its value member.
  *
  * This will return a cached connection if one is available.
  *
  * @return Status
  */
 public function getConnection()
 {
     if ($this->db) {
         return Status::newGood($this->db);
     }
     $status = $this->openConnection();
     if ($status->isOK()) {
         $this->db = $status->value;
         // Enable autocommit
         $this->db->clearFlag(DBO_TRX);
         $this->db->commit(__METHOD__);
     }
     return $status;
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:23,代码来源:DatabaseInstaller.php

示例4: getDB

 /**
  * @return DatabaseBase
  */
 protected function getDB()
 {
     if (!isset($this->db)) {
         # If server connection info was given, use that
         if ($this->serverInfo) {
             $this->lb = new LoadBalancer(array('servers' => array($this->serverInfo)));
             $this->db = $this->lb->getConnection(DB_MASTER);
             $this->db->clearFlag(DBO_TRX);
         } else {
             # We must keep a separate connection to MySQL in order to avoid deadlocks
             # However, SQLite has an opposite behaviour.
             # @todo Investigate behaviour for other databases
             if (wfGetDB(DB_MASTER)->getType() == 'sqlite') {
                 $this->db = wfGetDB(DB_MASTER);
             } else {
                 $this->lb = wfGetLBFactory()->newMainLB();
                 $this->db = $this->lb->getConnection(DB_MASTER);
                 $this->db->clearFlag(DBO_TRX);
             }
         }
     }
     return $this->db;
 }
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:26,代码来源:SqlBagOStuff.php

示例5: getDB

 /**
  * @return DatabaseBase
  */
 protected function getDB()
 {
     global $wgDebugDBTransactions;
     # Don't keep timing out trying to connect for each call if the DB is down
     if ($this->connFailureError && time() - $this->connFailureTime < 60) {
         throw $this->connFailureError;
     }
     if (!isset($this->db)) {
         # If server connection info was given, use that
         if ($this->serverInfo) {
             if ($wgDebugDBTransactions) {
                 wfDebug(sprintf("Using provided serverInfo for SqlBagOStuff\n"));
             }
             $this->lb = new LoadBalancer(array('servers' => array($this->serverInfo)));
             $this->db = $this->lb->getConnection(DB_MASTER);
             $this->db->clearFlag(DBO_TRX);
         } else {
             /*
              * We must keep a separate connection to MySQL in order to avoid deadlocks
              * However, SQLite has an opposite behaviour. And PostgreSQL needs to know
              * if we are in transaction or no
              */
             if (wfGetDB(DB_MASTER)->getType() == 'mysql') {
                 $this->lb = wfGetLBFactory()->newMainLB();
                 $this->db = $this->lb->getConnection(DB_MASTER);
                 $this->db->clearFlag(DBO_TRX);
                 // auto-commit mode
             } else {
                 $this->db = wfGetDB(DB_MASTER);
             }
         }
         if ($wgDebugDBTransactions) {
             wfDebug(sprintf("Connection %s will be used for SqlBagOStuff\n", $this->db));
         }
     }
     return $this->db;
 }
开发者ID:seedbank,项目名称:old-repo,代码行数:40,代码来源:SqlBagOStuff.php


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