• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP DatabaseUpdater类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了DatabaseUpdater类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


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


示例17: execute

 public function execute()
 {
     $dbw = $this->getDB(DB_MASTER);
     $updater = DatabaseUpdater::newForDB($dbw, true, $this);
     foreach ($this->mArgs as $arg) {
         $files = [$arg, $updater->patchPath($dbw, $arg), $updater->patchPath($dbw, "patch-{$arg}.sql")];
         foreach ($files as $file) {
             if (file_exists($file)) {
                 $this->output("{$file} ...\n");
                 $dbw->sourceFile($file);
                 continue 2;
             }
         }
         $this->error("Could not find {$arg}\n");
     }
     $this->output("done.\n");
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:17,代码来源:patchSql.php


示例18: checkUserSchemaUpdates

 /** Wikia change -- moved getClientIPfromXFF() method to IP class */
 public static function checkUserSchemaUpdates(DatabaseUpdater $updater)
 {
     $base = dirname(__FILE__);
     $updater->addExtensionUpdate(array('CheckUserHooks::checkUserCreateTables'));
     if ($updater->getDB()->getType() == 'mysql') {
         $updater->addExtensionUpdate(array('addIndex', 'cu_changes', 'cuc_ip_hex_time', "{$base}/archives/patch-cu_changes_indexes.sql", true));
         $updater->addExtensionUpdate(array('addIndex', 'cu_changes', 'cuc_user_ip_time', "{$base}/archives/patch-cu_changes_indexes2.sql", true));
     }
     return true;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:11,代码来源:CheckUser.hooks.php


示例19: onLoadExtensionSchemaUpdates

 public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater)
 {
     $base = dirname(__FILE__);
     $db = $updater->addExtensionTable('moderation', "{$base}/../sql/patch-moderation.sql");
     $db = $updater->addExtensionTable('moderation_block', "{$base}/../sql/patch-moderation_block.sql");
 }
开发者ID:ATCARES,项目名称:mediawiki-moderation,代码行数:6,代码来源:ModerationUpdater.php


示例20: onLoadExtensionSchemaUpdates

 public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater)
 {
     $dir = __DIR__ . '/sql';
     $updater->addExtensionTable('invitesignup', "{$dir}/invitesignup.sql");
 }
开发者ID:starnikser,项目名称:mediawiki-extensions-InviteSignup,代码行数:5,代码来源:InviteSignupHooks.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Database_Connection类代码示例发布时间:2022-05-23
下一篇:
PHP DatabaseTestCase类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap