$ext = explode( ' ', $ext );
$extension = strtolower( $extension );
- return in_array( $extension, $ext );
+ return in_array( $extension, $ext );
}
/**
);
if ( $wgContLang->hasVariants() ) {
$vars['wgUserVariant'] = $wgContLang->getPreferredVariant();
- }
+ }
foreach ( $title->getRestrictionTypes() as $type ) {
$vars['wgRestriction' . ucfirst( $type )] = $title->getRestrictions( $type );
}
'rc_params' => isset( $row->rc_params ) ? $row->rc_params : '',
'rc_log_type' => isset( $row->rc_log_type ) ? $row->rc_log_type : null,
'rc_log_action' => isset( $row->rc_log_action ) ? $row->rc_log_action : null,
- 'rc_log_id' => isset( $row->rc_log_id ) ? $row->rc_log_id: 0,
+ 'rc_logid' => isset( $row->rc_logid ) ? $row->rc_logid : 0,
'rc_deleted' => $row->rc_deleted // MUST be set
);
}
return $wgValidSkinNames;
}
- /**
+ /**
* Fetch the skinname messages for available skins.
* @return array of strings
*/
/**
* Unset an arbitrary value from our get/post data.
- *
+ *
* @param $key String: key name to use
* @return Mixed: old value if one was present, null otherwise
*/
$ret = true;
ob_start( array( $this, 'outputHandler' ) );
+ $up = DatabaseUpdater::newForDB( $this->db );
try {
- $up = DatabaseUpdater::newForDB( $this->db );
$up->doUpdates();
} catch ( MWException $e ) {
echo "\nAn error occurred:\n";
echo $e->getText();
$ret = false;
}
+ $up->purgeCache();
ob_end_flush();
return $ret;
}
*
* @param $what Array: what updates to perform
*/
- public function doUpdates( $what = array( 'core', 'extensions', 'purge', 'stats' ) ) {
- global $wgLocalisationCacheConf, $wgVersion;
+ public function doUpdates( $what = array( 'core', 'extensions', 'stats' ) ) {
+ global $wgVersion;
$this->db->begin( __METHOD__ );
$what = array_flip( $what );
if ( isset( $what['stats'] ) ) {
$this->checkStats();
}
-
- if ( isset( $what['purge'] ) ) {
- $this->purgeCache();
-
- if ( $wgLocalisationCacheConf['manualRecache'] ) {
- $this->rebuildLocalisationCache();
- }
- }
$this->db->commit( __METHOD__ );
}
/**
* Purge the objectcache table
*/
- protected function purgeCache() {
+ public function purgeCache() {
+ global $wgLocalisationCacheConf;
# We can't guarantee that the user will be able to use TRUNCATE,
# but we know that DELETE is available to us
$this->output( "Purging caches..." );
$this->db->delete( 'objectcache', '*', __METHOD__ );
+ if ( $wgLocalisationCacheConf['manualRecache'] ) {
+ $this->rebuildLocalisationCache();
+ }
$this->output( "done.\n" );
}
return $this->encode2($var);
}
- /**
+ /**
* encodes an arbitrary variable into JSON format
*
* @param $var Mixed: any number, boolean, string, array, or object to be encoded.
try {
$metadata = SVGMetadataExtractor::getMetadata( $filename );
} catch( Exception $e ) {
- // Broken file?
+ // Broken file?
wfDebug( __METHOD__ . ': ' . $e->getMessage() . "\n" );
return '0';
}
}
}
- /**
+ /**
* Don't serialize the parent object, it is big, and not needed when it is
* a parameter to mergeForeign(), which is the only application of
* serializing at present.
return array_keys( $this->moduleInfos );
}
- /**
+ /**
* Get a list of test module names for one (or all) frameworks.
* If the given framework id is unknkown, or if the in-object variable is not an array,
* then it will return an empty array.
us_sha1 varchar(31) NOT NULL,
us_mime varchar(255),
-- Media type as defined by the MEDIATYPE_xxx constants, should duplicate definition in the image table
- us_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
+ us_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
-- image-specific properties
us_image_width int unsigned,
us_image_height int unsigned,
$shared = $this->hasOption( 'doshared' );
$updates = array( 'core', 'extensions', 'stats' );
- if( !$this->hasOption('nopurge') ) {
- $updates[] = 'purge';
- }
$updater = DatabaseUpdater::newForDb( $db, $shared, $this );
$updater->doUpdates( $updates );
}
}
+ if( !$this->hasOption('nopurge') ) {
+ $updater->purgeCache();
+ }
+
$this->output( "\nDone.\n" );
}
us_size int unsigned NOT NULL,
us_sha1 varchar(31) NOT NULL,
us_mime varchar(255),
- us_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
+ us_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
us_image_width int unsigned,
us_image_height int unsigned,
us_image_bits smallint unsigned
* test @see wfBCP47().
* Please note the BCP explicitly state that language codes are case
* insensitive, there are some exceptions to the rule :)
- * This test is used to verify our formatting against all lower and
+ * This test is used to verify our formatting against all lower and
* all upper cases language code.
*
* @see http://tools.ietf.org/html/bcp47
* $wgCapitalLinkOverrides = array(); by default
* $wgCapitalLinks = true; by default
* This function test $wgCapitalLinks
- *
+ *
* Global setting correctness is tested against the NS_PROJECT and
* NS_PROJECT_TALK namespaces since they are not hardcoded nor specials
*/