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


PHP DatabaseUpdater類代碼示例

本文整理匯總了PHP中DatabaseUpdater的典型用法代碼示例。如果您正苦於以下問題:PHP DatabaseUpdater類的具體用法?PHP DatabaseUpdater怎麽用?PHP DatabaseUpdater使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了DatabaseUpdater類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onSchemaUpdate

 /**
  * Schema update to set up the needed database tables.
  *
  * @since 0.1
  *
  * @param DatabaseUpdater $updater
  *
  * @return true
  */
 public static function onSchemaUpdate(DatabaseUpdater $updater)
 {
     global $wgDBtype;
     $updater->addExtensionUpdate(array('addTable', 'surveys', dirname(__FILE__) . '/sql/Survey.sql', true));
     $updater->addExtensionUpdate(array('addIndex', 'surveys', 'surveys_survey_title', dirname(__FILE__) . '/sql/AddMissingIndexes.sql', true));
     return true;
 }
開發者ID:Tjorriemorrie,項目名稱:app,代碼行數:16,代碼來源:Survey.hooks.php

示例2: SemanticMailMerge_SchemaUpdates

function SemanticMailMerge_SchemaUpdates(DatabaseUpdater $updater)
{
    $sqldir = __DIR__ . '/maintenance/';
    $updater->addExtensionTable('smw_mailmerge', $sqldir . 'table.sql');
    $updater->addExtensionIndex('smw_mailmerge', 'title', $sqldir . 'index.sql');
    return true;
}
開發者ID:ATCARES,項目名稱:SemanticMailMerge,代碼行數:7,代碼來源:SemanticMailMerge.php

示例3: onSchemaUpdate

 /**
  * Schema update to set up the needed database tables.
  * @see https://www.mediawiki.org/wiki/Manual:Hooks/LoadExtensionSchemaUpdates
  *
  * @since 0.1
  *
  * @param DatabaseUpdater $updater
  *
  * @return true
  */
 public static function onSchemaUpdate(DatabaseUpdater $updater)
 {
     $updater->addExtensionUpdate(array('addTable', 'contests', dirname(__FILE__) . '/Contest.sql', true));
     $updater->addExtensionUpdate(array('addField', 'contests', 'contest_signup_email', dirname(__FILE__) . '/sql/AddContestEmailFields.sql', true));
     $updater->addExtensionUpdate(array('applyPatch', dirname(__FILE__) . '/sql/UpdateContestantRatingField.sql', true));
     return true;
 }
開發者ID:realsoc,項目名稱:mediawiki-extensions,代碼行數:17,代碼來源:Contest.hooks.php

示例4: onLoadExtensionSchemaUpdates

 public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater = null)
 {
     $dbDir = __DIR__ . '/db';
     $updater->addExtensionUpdate(array('addtable', 'page_assessments', "{$dbDir}/addReviewsTable.sql", true));
     $updater->addExtensionUpdate(array('addtable', 'page_assessments_log', "{$dbDir}/addLoggingTable.sql", true));
     return true;
 }
開發者ID:fhocutt,項目名稱:Assessments,代碼行數:7,代碼來源:PageAssessments.hooks.php

示例5: onLoadExtensionSchemaUpdates

 /**
  * LoadExtensionSchemaUpdates hook handler
  * @see https://www.mediawiki.org/wiki/Manual:Hooks/LoadExtensionSchemaUpdates
  * @param DatabaseUpdater $updater
  */
 public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater)
 {
     if ($updater->getDB()->getType() != 'mysql') {
         throw new MWException('GeoData extension currently supports only MySQL');
     }
     $updater->addExtensionTable('geo_tags', dirname(__FILE__) . '/GeoData.sql');
     return true;
 }
開發者ID:realsoc,項目名稱:mediawiki-extensions,代碼行數:13,代碼來源:GeoDataHooks.php

示例6: SetupSchema

	public static function SetupSchema( DatabaseUpdater $du ) {
		$base = dirname( __FILE__ ) . '/schema';
		$du->addExtensionTable( "ratings", "$base/ratings.sql");
		$du->addExtensionTable( "project_stats", "$base/project_stats.sql" );
		$du->addExtensionTable( "assessment_changelog", "$base/log.sql" );
		$du->addExtensionTable( "selections", "$base/selections.sql" );
		return true;
	}
開發者ID:realsoc,項目名稱:mediawiki-extensions,代碼行數:8,代碼來源:SelectionSifter.hooks.php

示例7: onSchemaUpdate

 /**
  * Schema update to set up the needed database tables.
  *
  * @since 0.1
  *
  * @param DatabaseUpdater $updater
  *
  * @return true
  */
 public static function onSchemaUpdate($updater = null)
 {
     global $wgDBtype;
     if ($wgDBtype == 'mysql') {
         $updater->addExtensionUpdate(array('addTable', 'article_protection', dirname(__FILE__) . '/ArticleProtection.sql', true));
     }
     return true;
 }
開發者ID:nathancarter,項目名稱:ArticleProtection,代碼行數:17,代碼來源:ArticleProtection.hooks.php

示例8: onSchemaUpdate

 /**
  * Schema update to set up the needed database tables.
  * @see https://www.mediawiki.org/wiki/Manual:Hooks/LoadExtensionSchemaUpdates
  *
  * @since 0.1
  *
  * @param DatabaseUpdater $updater
  *
  * @return true
  */
 public static function onSchemaUpdate(DatabaseUpdater $updater)
 {
     $updater->addExtensionTable('ep_orgs', dirname(__FILE__) . '/sql/EducationProgram.sql');
     $updater->addExtensionUpdate(array('addTable', 'ep_oas_per_course', dirname(__FILE__) . '/sql/AddAmbassadorLinks.sql', true));
     $updater->addExtensionUpdate(array('addField', 'ep_oas_per_course', 'opc_user_id', dirname(__FILE__) . '/sql/RenameAmbUserField.sql', true));
     $updater->addExtensionUpdate(array('addField', 'ep_revisions', 'rev_object_identifier', dirname(__FILE__) . '/sql/AddRevIdentifier.sql', true));
     return true;
 }
開發者ID:schwarer2006,項目名稱:wikia,代碼行數:18,代碼來源:EducationProgram.hooks.php

示例9: onSchemaUpdate

 /**
  * Schema update to set up the needed database tables.
  *
  * @since 1.2
  *
  * @param DatabaseUpdater $updater
  *
  * @return true
  */
 public static function onSchemaUpdate($updater = null)
 {
     $updater->addExtensionTable('uw_campaigns', dirname(__FILE__) . '/UploadWizard.sql');
     $updater->addExtensionUpdate(array('addIndex', 'uw_campaigns', 'uw_campaigns_name', dirname(__FILE__) . '/sql/UW_IndexCampaignsName.sql', true));
     $updater->addExtensionUpdate(array('addIndex', 'uw_campaign_conf', 'uw_cc_id_property', dirname(__FILE__) . '/sql/UW_IndexConfIdProp.sql', true));
     $updater->addExtensionUpdate(array('addIndex', 'uw_campaign_conf', 'uw_cc_property', dirname(__FILE__) . '/sql/UW_IndexConfProp.sql', true));
     return true;
 }
開發者ID:JeroenDeDauw,項目名稱:UploadWizard,代碼行數:17,代碼來源:UploadWizardHooks.php

示例10: describeDBSchema

 public static function describeDBSchema(DatabaseUpdater $updater = null)
 {
     $dir = __DIR__ . '/sql';
     // For now, there's just a single SQL file for all DB types.
     $updater->addExtensionUpdate(array('addTable', 'approved_pages', "{$dir}/ApprovedRevs.sql", true));
     $updater->addExtensionUpdate(array('modifyField', 'approved_pages', 'ap_user_group', "{$dir}/patch-ap_group-length-increase-255.sql", true));
     $updater->addExtensionUpdate(array('addIndex', 'approved_pages', 'approved_pages_page_id', "{$dir}/patch-add-indices.sql", true));
     return true;
 }
開發者ID:kolzchut,項目名稱:mediawiki-extensions-WRApprovedRevs,代碼行數:9,代碼來源:ApprovedRevs.hooks.php

示例11: ckSchema

 /**
  * @param DatabaseUpdater|null $updater
  * @return bool
  */
 public static function ckSchema($updater = null)
 {
     if ($updater !== null) {
         $updater->addExtensionUpdate(array('addtable', 'online_status', dirname(__FILE__) . '/OnlineStatusBar.sql', true));
     } else {
         global $wgExtNewTables;
         $wgExtNewTables[] = array('online_status', dirname(__FILE__) . '/OnlineStatusBar.sql');
     }
     return true;
 }
開發者ID:schwarer2006,項目名稱:wikia,代碼行數:14,代碼來源:OnlineStatusBar.hooks.php

示例12: onSchemaUpdate

 /**
  * Schema update to set up the needed database tables.
  *
  * @since 1.2
  *
  * @param DatabaseUpdater $updater
  *
  * @return true
  */
 public static function onSchemaUpdate($updater = null)
 {
     $dbfile = dirname(__FILE__) . '/UploadWizard.' . $updater->getDB()->getType() . '.sql';
     if (!file_exists($dbfile)) {
         $dbfile = dirname(__FILE__) . '/UploadWizard.sql';
     }
     $updater->addExtensionTable('uw_campaigns', $dbfile);
     $updater->addExtensionUpdate(array('addIndex', 'uw_campaigns', 'uw_campaigns_name', dirname(__FILE__) . '/sql/UW_IndexCampaignsName.sql', true));
     $updater->addExtensionUpdate(array('addIndex', 'uw_campaigns', 'uw_campaigns_enabled', dirname(__FILE__) . '/sql/UW_IndexCampaignsEnabled.sql', true));
     return true;
 }
開發者ID:robksawyer,項目名稱:lathe.tools,代碼行數:20,代碼來源:UploadWizardHooks.php

示例13: onSchemaUpdate

 /**
  * Schema update to set up the needed database tables.
  * 
  * @since 0.1
  * 
  * @param DatabaseUpdater $updater
  * 
  * @return true
  */
 public static function onSchemaUpdate($updater = null)
 {
     global $wgDBtype;
     if ($wgDBtype == 'mysql') {
         // Set up the current schema.
         if ($updater === null) {
             global $wgExtNewTables, $wgExtNewIndexes, $wgExtNewFields;
             $wgExtNewTables[] = array('votes', dirname(__FILE__) . '/Ratings.sql', true);
             $wgExtNewTables[] = array('votes_props', dirname(__FILE__) . '/Ratings.sql', true);
         } else {
             $updater->addExtensionUpdate(array('addTable', 'votes', dirname(__FILE__) . '/Ratings.sql', true));
             $updater->addExtensionUpdate(array('addTable', 'votes_props', dirname(__FILE__) . '/Ratings.sql', true));
         }
     }
     return true;
 }
開發者ID:JeroenDeDauw,項目名稱:Ratings,代碼行數:25,代碼來源:Ratings.hooks.php

示例14: onLoadExtensionSchemaUpdates

 public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater)
 {
     $tables = array('wp_plan', 'wp_subscription', 'wp_old_usage', 'wp_wikiplace', 'wp_page', 'wp_old_subscription', 'wp_invitation', 'wp_invitation_category', 'wp_wpi_wpp', 'wp_member');
     $mysql_dir = dirname(__FILE__) . '/schema/mysql';
     foreach ($tables as $table) {
         $updater->addExtensionUpdate(array('addTable', $table, "{$mysql_dir}/{$table}.sql", true));
     }
     $db = wfGetDB(DB_MASTER);
     if ($db->tableExists('wp_subscription') && !$db->fieldExists('wp_subscription', 'wps_wpi_id', __METHOD__)) {
         $db->sourceFile("{$mysql_dir}/add_wps_wpi_field.sql");
     }
     if ($db->tableExists('wp_old_subscription') && !$db->fieldExists('wp_old_subscription', 'wpos_wpi_id', __METHOD__)) {
         $db->sourceFile("{$mysql_dir}/add_wpos_wpi_field.sql");
     }
     return true;
 }
開發者ID:eFFemeer,項目名稱:seizamcore,代碼行數:16,代碼來源:Wikiplaces.hooks.php

示例15: execute

 function execute()
 {
     global $wgVersion, $wgTitle, $wgLang;
     $wgLang = Language::factory('en');
     $wgTitle = Title::newFromText("MediaWiki database updater");
     $this->output("MediaWiki {$wgVersion} Updater\n\n");
     if (!$this->hasOption('skip-compat-checks')) {
         $this->compatChecks();
     } else {
         $this->output("Skipping compatibility checks, proceed at your own risk (Ctrl+C to abort)\n");
         wfCountdown(5);
     }
     # Attempt to connect to the database as a privileged user
     # This will vomit up an error if there are permissions problems
     $db = wfGetDB(DB_MASTER);
     $this->output("Going to run database updates for " . wfWikiID() . "\n");
     $this->output("Depending on the size of your database this may take a while!\n");
     if (!$this->hasOption('quick')) {
         $this->output("Abort with control-c in the next five seconds (skip this countdown with --quick) ... ");
         wfCountDown(5);
     }
     $shared = $this->hasOption('doshared');
     $updates = array('core', 'extensions');
     if (!$this->hasOption('nopurge')) {
         $updates[] = 'purge';
     }
     $updater = DatabaseUpdater::newForDb($db, $shared, $this);
     $updater->doUpdates($updates);
     foreach ($updater->getPostDatabaseUpdateMaintenance() as $maint) {
         $child = $this->runChild($maint);
         $child->execute();
     }
     $this->output("\nDone.\n");
 }
開發者ID:GodelDesign,項目名稱:Godel,代碼行數:34,代碼來源:update.php


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