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


PHP DatabaseBase::setFlag方法代码示例

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


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

示例1: __construct

 /**
  * Constructor
  *
  * @param $db DatabaseBase object to perform updates on
  * @param $shared bool Whether to perform updates on shared tables
  * @param $maintenance Maintenance Maintenance object which created us
  */
 protected function __construct(DatabaseBase &$db, $shared, Maintenance $maintenance = null)
 {
     $this->db = $db;
     $this->db->setFlag(DBO_DDLMODE);
     // For Oracle's handling of schema files
     $this->shared = $shared;
     if ($maintenance) {
         $this->maintenance = $maintenance;
     } else {
         $this->maintenance = new FakeMaintenance();
     }
     $this->initOldGlobals();
     $this->loadExtensions();
     wfRunHooks('LoadExtensionSchemaUpdates', array($this));
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:22,代码来源:DatabaseUpdater.php

示例2: createTables

 /**
  * Create database tables from scratch.
  *
  * @return Status
  */
 public function createTables()
 {
     $status = $this->getConnection();
     if (!$status->isOK()) {
         return $status;
     }
     $this->db->selectDB($this->getVar('wgDBname'));
     if ($this->db->tableExists('archive', __METHOD__)) {
         $status->warning('config-install-tables-exist');
         $this->enableLB();
         return $status;
     }
     $this->db->setFlag(DBO_DDLMODE);
     // For Oracle's handling of schema files
     $this->db->begin(__METHOD__);
     $error = $this->db->sourceFile($this->db->getSchemaPath());
     if ($error !== true) {
         $this->db->reportQueryError($error, 0, '', __METHOD__);
         $this->db->rollback(__METHOD__);
         $status->fatal('config-install-tables-failed', $error);
     } else {
         $this->db->commit(__METHOD__);
     }
     // Resume normal operations
     if ($status->isOk()) {
         $this->enableLB();
     }
     return $status;
 }
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:34,代码来源:DatabaseInstaller.php

示例3: stepApplySourceFile

 /**
  * Apply a SQL source file to the database as part of running an installation step.
  *
  * @param string $sourceFileMethod
  * @param string $stepName
  * @param string $archiveTableMustNotExist
  * @return Status
  */
 private function stepApplySourceFile($sourceFileMethod, $stepName, $archiveTableMustNotExist = false)
 {
     $status = $this->getConnection();
     if (!$status->isOK()) {
         return $status;
     }
     $this->db->selectDB($this->getVar('wgDBname'));
     if ($archiveTableMustNotExist && $this->db->tableExists('archive', __METHOD__)) {
         $status->warning("config-{$stepName}-tables-exist");
         $this->enableLB();
         return $status;
     }
     $this->db->setFlag(DBO_DDLMODE);
     // For Oracle's handling of schema files
     $this->db->begin(__METHOD__);
     $error = $this->db->sourceFile(call_user_func(array($this->db, $sourceFileMethod)));
     if ($error !== true) {
         $this->db->reportQueryError($error, 0, '', __METHOD__);
         $this->db->rollback(__METHOD__);
         $status->fatal("config-{$stepName}-tables-failed", $error);
     } else {
         $this->db->commit(__METHOD__);
     }
     // Resume normal operations
     if ($status->isOk()) {
         $this->enableLB();
     }
     return $status;
 }
开发者ID:MediaWiki-stable,项目名称:1.26.1,代码行数:37,代码来源:DatabaseInstaller.php

示例4: 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


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