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


PHP DatabaseUpdater::updateRowExists方法代码示例

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


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

示例1: getSchemaUpdates

 /**
  * Hook: LoadExtensionSchemaUpdates
  *
  * @param $updater DatabaseUpdater object
  * @return bool true in all cases
  */
 public static function getSchemaUpdates(DatabaseUpdater $updater)
 {
     $dir = __DIR__;
     $baseSQLFile = "{$dir}/flow.sql";
     $updater->addExtensionTable('flow_revision', $baseSQLFile);
     $updater->addExtensionField('flow_revision', 'rev_last_edit_id', "{$dir}/db_patches/patch-revision_last_editor.sql");
     $updater->addExtensionField('flow_revision', 'rev_mod_reason', "{$dir}/db_patches/patch-moderation_reason.sql");
     if ($updater->getDB()->getType() === 'sqlite') {
         $updater->modifyExtensionField('flow_summary_revision', 'summary_workflow_id', "{$dir}/db_patches/patch-summary2header.sqlite.sql");
         $updater->modifyExtensionField('flow_revision', 'rev_comment', "{$dir}/db_patches/patch-rev_change_type.sqlite.sql");
         // sqlite ignores field types, this just substr's uuid's to 88 bits
         $updater->modifyExtensionField('flow_workflow', 'workflow_id', "{$dir}/db_patches/patch-88bit_uuids.sqlite.sql");
         $updater->addExtensionField('flow_workflow', 'workflow_type', "{$dir}/db_patches/patch-add_workflow_type.sqlite");
         $updater->modifyExtensionField('flow_workflow', 'workflow_user_id', "{$dir}/db_patches/patch-default_null_workflow_user.sqlite.sql");
     } else {
         // sqlite doesn't support alter table change, it also considers all types the same so
         // this patch doesn't matter to it.
         $updater->modifyExtensionField('flow_subscription', 'subscription_user_id', "{$dir}/db_patches/patch-subscription_user_id.sql");
         // renames columns, alternate patch is above for sqlite
         $updater->modifyExtensionField('flow_summary_revision', 'summary_workflow_id', "{$dir}/db_patches/patch-summary2header.sql");
         // rename rev_change_type -> rev_comment, alternate patch is above for sqlite
         $updater->modifyExtensionField('flow_revision', 'rev_comment', "{$dir}/db_patches/patch-rev_change_type.sql");
         // convert 128 bit uuid's into 88bit
         $updater->modifyExtensionField('flow_workflow', 'workflow_id', "{$dir}/db_patches/patch-88bit_uuids.sql");
         $updater->addExtensionField('flow_workflow', 'workflow_type', "{$dir}/db_patches/patch-add_workflow_type.sql");
         $updater->modifyExtensionField('flow_workflow', 'workflow_user_id', "{$dir}/db_patches/patch-default_null_workflow_user.sql");
         // Doesn't need SQLite support, since SQLite doesn't care about text widths.
         $updater->modifyExtensionField('flow_workflow', 'workflow_wiki', "{$dir}/db_patches/patch-increase_width_wiki_fields.sql");
     }
     $updater->addExtensionIndex('flow_workflow', 'flow_workflow_lookup', "{$dir}/db_patches/patch-workflow_lookup_idx.sql");
     $updater->addExtensionIndex('flow_topic_list', 'flow_topic_list_topic_id', "{$dir}/db_patches/patch-topic_list_topic_id_idx.sql");
     $updater->modifyExtensionField('flow_revision', 'rev_change_type', "{$dir}/db_patches/patch-rev_change_type_update.sql");
     $updater->modifyExtensionField('recentchanges', 'rc_source', "{$dir}/db_patches/patch-rc_source.sql");
     $updater->modifyExtensionField('flow_revision', 'rev_change_type', "{$dir}/db_patches/patch-censor_to_suppress.sql");
     $updater->addExtensionField('flow_revision', 'rev_user_ip', "{$dir}/db_patches/patch-remove_usernames.sql");
     $updater->addExtensionField('flow_revision', 'rev_user_wiki', "{$dir}/db_patches/patch-add-wiki.sql");
     $updater->addExtensionIndex('flow_tree_revision', 'flow_tree_descendant_rev_id', "{$dir}/db_patches/patch-flow_tree_idx_fix.sql");
     $updater->dropExtensionField('flow_tree_revision', 'tree_orig_create_time', "{$dir}/db_patches/patch-tree_orig_create_time.sql");
     $updater->addExtensionIndex('flow_revision', 'flow_revision_user', "{$dir}/db_patches/patch-revision_user_idx.sql");
     $updater->modifyExtensionField('flow_revision', 'rev_user_ip', "{$dir}/db_patches/patch-revision_user_ip.sql");
     $updater->addExtensionField('flow_revision', 'rev_type_id', "{$dir}/db_patches/patch-rev_type_id.sql");
     $updater->addExtensionTable('flow_ext_ref', "{$dir}/db_patches/patch-add-linkstables.sql");
     $updater->dropExtensionTable('flow_definition', "{$dir}/db_patches/patch-drop_definition.sql");
     $updater->dropExtensionField('flow_workflow', 'workflow_user_ip', "{$dir}/db_patches/patch-drop_workflow_user.sql");
     $updater->addExtensionField('flow_revision', 'rev_content_length', "{$dir}/db_patches/patch-add-revision-content-length.sql");
     $updater->addExtensionIndex('flow_ext_ref', 'flow_ext_ref_idx', "{$dir}/db_patches/patch-remove_unique_ref_indices.sql");
     $updater->addExtensionIndex('flow_workflow', 'flow_workflow_update_timestamp', "{$dir}/db_patches/patch-flow_workflow_update_timestamp_idx.sql");
     require_once __DIR__ . '/maintenance/FlowUpdateRecentChanges.php';
     $updater->addPostDatabaseUpdateMaintenance('FlowUpdateRecentChanges');
     require_once __DIR__ . '/maintenance/FlowSetUserIp.php';
     $updater->addPostDatabaseUpdateMaintenance('FlowSetUserIp');
     /*
      * Remove old *_user_text columns once the maintenance script that
      * moves the necessary data has been run.
      * This duplicates what is being done in FlowSetUserIp already, but that
      * was not always the case, so that script may have already run without
      * having executed this.
      */
     if ($updater->updateRowExists('FlowSetUserIp')) {
         $updater->dropExtensionField('flow_revision', 'rev_user_text', "{$dir}/db_patches/patch-remove_usernames_2.sql");
     }
     require_once __DIR__ . '/maintenance/FlowUpdateUserWiki.php';
     $updater->addPostDatabaseUpdateMaintenance('FlowUpdateUserWiki');
     require_once __DIR__ . '/maintenance/FlowUpdateRevisionTypeId.php';
     $updater->addPostDatabaseUpdateMaintenance('FlowUpdateRevisionTypeId');
     require_once __DIR__ . '/maintenance/FlowPopulateLinksTables.php';
     $updater->addPostDatabaseUpdateMaintenance('FlowPopulateLinksTables');
     require_once __DIR__ . '/maintenance/FlowFixLog.php';
     $updater->addPostDatabaseUpdateMaintenance('FlowFixLog');
     require_once __DIR__ . '/maintenance/FlowUpdateWorkflowPageId.php';
     $updater->addPostDatabaseUpdateMaintenance('FlowUpdateWorkflowPageId');
     require_once __DIR__ . '/maintenance/FlowCreateMentionTemplate.php';
     $updater->addPostDatabaseUpdateMaintenance('FlowCreateMentionTemplate');
     return true;
 }
开发者ID:TarLocesilion,项目名称:mediawiki-extensions-Flow,代码行数:81,代码来源:Hooks.php


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