本文整理汇总了PHP中DatabaseUpdater::addExtensionTable方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseUpdater::addExtensionTable方法的具体用法?PHP DatabaseUpdater::addExtensionTable怎么用?PHP DatabaseUpdater::addExtensionTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseUpdater
的用法示例。
在下文中一共展示了DatabaseUpdater::addExtensionTable方法的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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例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;
}
示例8: 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;
}
示例9: asUpdateSchema
/**
* @param $updater DatabaseUpdater
* @return bool
*/
public static function asUpdateSchema(DatabaseUpdater $updater)
{
$updater->addExtensionTable('spoofuser', __DIR__ . '/sql/patch-antispoof.' . $updater->getDB()->getType() . '.sql');
return true;
}
示例10: onLoadExtensionSchemaUpdates
/**
* @param DatabaseUpdater $updater
*/
public static function onLoadExtensionSchemaUpdates($updater)
{
$updater->addExtensionTable('author_rating', dirname(__FILE__) . '/schema/author_rating.sql');
}
示例11: onLoadExtensionSchemaUpdates
/**
* @param DatabaseUpdater $updater
*/
public static function onLoadExtensionSchemaUpdates($updater)
{
global $wgOpauthLoginDir;
$updater->addExtensionTable('opauth_login', $wgOpauthLoginDir . '/schema/opauth_login.sql');
}
示例12: onLoadExtensionSchemaUpdates
/**
* This will setup database tables for layer functionality.
*
* @since 3.0
*
* @param DatabaseUpdater $updater
*
* @return true
*/
public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater)
{
switch ($GLOBALS['wgDBtype']) {
case 'mysql':
case 'sqlite':
$updater->addExtensionTable('maps_layers', __DIR__ . '/schema/MapsLayers.sql');
break;
case 'postgres':
$updater->addExtensionTable('maps_layers', __DIR__ . '/schema/MapsLayers-postgres.sql');
break;
}
return true;
}
示例13: onLoadExtensionSchemaUpdates
/**
* This will setup database tables for layer functionality.
*
* @since 3.0
*
* @global type $wgDBtype
* @param DatabaseUpdater $updater
*
* @return true
*/
public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater)
{
global $wgDBtype;
switch ($wgDBtype) {
case 'mysql':
case 'sqlite':
$sqlPath = dirname(__FILE__) . '/schema/MapsLayers.sql';
break;
/** @ToDo: Support for Postgree SQL and others **/
}
$updater->addExtensionTable('maps_layers', $sqlPath);
return true;
}
示例14: onLoadExtensionSchemaUpdates
public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater)
{
$dir = __DIR__ . '/sql';
$updater->addExtensionTable('invitesignup', "{$dir}/invitesignup.sql");
}
示例15: onLoadExtensionSchemaUpdates
/**
* This registers our database schema update(s)
*/
public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater)
{
$updater->addExtensionTable('spell_dict_word_list', dirname(__FILE__) . '/sql/spelling_dictionary.sql', true);
return true;
}