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


PHP DatabaseUpdater::addExtensionUpdate方法代码示例

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


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

示例1: addSchemaUpdates

 /**
  * @param DatabaseUpdater $updater
  * @return bool
  */
 public static function addSchemaUpdates(DatabaseUpdater $updater)
 {
     $base = dirname(__FILE__);
     if ($updater->getDB()->getType() == 'mysql') {
         $base = "{$base}/mysql";
         $updater->addExtensionTable('account_requests', "{$base}/ConfirmAccount.sql", true);
         $updater->addExtensionField('account_requests', 'acr_filename', "{$base}/patch-acr_filename.sql");
         $updater->addExtensionTable('addTable', 'account_credentials', "{$base}/patch-account_credentials.sql", true);
         $updater->addExtensionField('account_requests', 'acr_areas', "{$base}/patch-acr_areas.sql", true);
         $updater->addExtensionIndex('account_requests', 'acr_email', "{$base}/patch-email-index.sql", true);
     } elseif ($updater->getDB()->getType() == 'postgres') {
         $base = "{$base}/postgres";
         $updater->addExtensionUpdate(array('addTable', 'account_requests', "{$base}/ConfirmAccount.pg.sql", true));
         $updater->addExtensionUpdate(array('addPgField', 'account_requests', 'acr_held', "TIMESTAMPTZ"));
         $updater->addExtensionUpdate(array('addPgField', 'account_requests', 'acr_filename', "TEXT"));
         $updater->addExtensionUpdate(array('addPgField', 'account_requests', 'acr_storage_key', "TEXT"));
         $updater->addExtensionUpdate(array('addPgField', 'account_requests', 'acr_comment', "TEXT NOT NULL DEFAULT ''"));
         $updater->addExtensionUpdate(array('addPgField', 'account_requests', 'acr_type', "INTEGER NOT NULL DEFAULT 0"));
         $updater->addExtensionUpdate(array('addTable', 'account_credentials', "{$base}/patch-account_credentials.sql", true));
         $updater->addExtensionUpdate(array('addPgField', 'account_requests', 'acr_areas', "TEXT"));
         $updater->addExtensionUpdate(array('addPgField', 'account_credentials', 'acd_areas', "TEXT"));
         $updater->addExtensionUpdate(array('addIndex', 'account_requests', 'acr_email', "{$base}/patch-email-index.sql", true));
     }
     return true;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:29,代码来源:ConfirmAccountUpdater.hooks.php

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

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

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

示例7: 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('addField', 'ep_orgs', 'org_courses', dirname(__FILE__) . '/sql/AddExtraFields.sql', true));
     $updater->addExtensionUpdate(array('addField', 'ep_orgs', 'org_active', dirname(__FILE__) . '/sql/AddStatusFields.sql', true));
     $updater->addExtensionUpdate(array('addField', 'ep_courses', 'course_instructors', dirname(__FILE__) . '/sql/AddMentorFields.sql', true));
     $updater->addExtensionUpdate(array('addField', 'ep_terms', 'term_students', dirname(__FILE__) . '/sql/AddStudentsField.sql', true));
     return true;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:19,代码来源:EducationProgram.hooks.php

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

示例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)
 {
     $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

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

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

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

示例13: update

 public static function update(DatabaseUpdater $updater)
 {
     global $wgCityId, $wgDBname, $wgExternalSharedDB;
     $dir = self::get_patch_dir();
     $ext_dir = self::get_extensions_dir();
     $wikia_update = array(array('addTable', 'page_vote', $dir . 'patch-create-page_vote.sql', true), array('addTable', 'page_visited', $dir . 'patch-create-page_visited.sql', true), array('addTable', 'blog_listing_relation', $dir . 'patch-create-blog_listing_relation.sql', true), array('addTable', 'page_wikia_props', $ext_dir . '/wikia/ImageServing/sql/table.sql', true), array('addTable', 'wall_history', $ext_dir . '/wikia/Wall/sql/wall_history_local.sql', true), array('addTable', 'wall_related_pages', $ext_dir . '/wikia/Wall/sql/wall_related_pages.sql', true), array('addTable', 'ach_user_score', $dir . 'patch-create-achievements_user_score.sql', true), array('addTable', 'ach_user_badges', $dir . 'patch-create-achievements_user_badges.sql', true), array('addTable', 'ach_user_badges_notified', $dir . 'patch-create-achievements_user_badges_notified.sql', true), array('addTable', 'ach_user_counters', $dir . 'patch-create-achievements_user_counters.sql', true), array('addTable', 'ach_custom_badges', $dir . 'patch-create-achievements_custom_badges.sql', true), array('addTable', 'ach_ranking_snapshots', $dir . 'patch-create-achievements_ranking_snapshots.sql', true), array('addField', 'watchlist', 'wl_wikia_addedtimestamp', $dir . 'patch-watchlist-improvements.sql', true), array('addIndex', 'archive', 'page_revision', $dir . 'patch-index-archive-page_revision.sql', true), array('WikiaUpdater::do_page_vote_unique_update'), array('WikiaUpdater::do_page_wikia_props_update'), array('WikiaUpdater::do_drop_table', 'imagetags'), array('WikiaUpdater::do_drop_table', 'send_queue'), array('WikiaUpdater::do_drop_table', 'send_stats'), array('WikiaUpdater::do_drop_table', 'validate'), array('WikiaUpdater::do_drop_table', 'cur'), array('WikiaUpdater::do_drop_table', 'searchindex', !empty($wgCityId)), array('WikiaUpdater::do_drop_table', 'page_stats'), array('WikiaUpdater::do_drop_table', 'user_board'), array('WikiaUpdater::do_drop_table', 'user_points_monthly'), array('WikiaUpdater::do_drop_table', 'user_points_weekly'), array('WikiaUpdater::do_drop_table', 'user_gift'), array('WikiaUpdater::do_drop_table', 'user_relationship_request'), array('WikiaUpdater::do_drop_table', 'user_register_track'), array('WikiaUpdater::do_drop_table', 'user_board'), array('WikiaUpdater::do_drop_table', 'watchlist_old'), array('WikiaUpdater::do_clean_math_table'), array('WikiaUpdater::do_transcache_update'));
     if ($wgDBname === $wgExternalSharedDB) {
         $wikia_update[] = array('addTable', 'city_list', $dir . 'wf/patch-create-city_list.sql', true);
         $wikia_update[] = array('addTable', 'city_list', $dir . 'wf/patch-create-city_cats.sql', true);
     }
     foreach ($wikia_update as $update) {
         $updater->addExtensionUpdate($update);
     }
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:15,代码来源:WikiaUpdater.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: addDatabases

 public static function addDatabases(DatabaseUpdater $updater)
 {
     $updater->addExtensionUpdate(array('addTable', SqlSentences::$ratingRecordTable, __DIR__ . '/sql/create-rating-history-table.sql', true));
     return true;
 }
开发者ID:kafuuchino,项目名称:MoegirlRating,代码行数:5,代码来源:MoegirlRating.hooks.php


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