dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Convert article delete to use OOUI"
[lhc/web/wiklou.git]
/
includes
/
registration
/
ExtensionRegistry.php
diff --git
a/includes/registration/ExtensionRegistry.php
b/includes/registration/ExtensionRegistry.php
index
344dd8f
..
eac04a9
100644
(file)
--- a/
includes/registration/ExtensionRegistry.php
+++ b/
includes/registration/ExtensionRegistry.php
@@
-31,7
+31,7
@@
class ExtensionRegistry {
/**
* Bump whenever the registration cache needs resetting
*/
/**
* Bump whenever the registration cache needs resetting
*/
- const CACHE_VERSION =
5
;
+ const CACHE_VERSION =
6
;
/**
* Special key that defines the merge strategy
/**
* Special key that defines the merge strategy
@@
-111,7
+111,7
@@
class ExtensionRegistry {
* be loaded then).
*/
public function loadFromQueue() {
* be loaded then).
*/
public function loadFromQueue() {
- global $wgVersion;
+ global $wgVersion
, $wgDevelopmentWarnings
;
if ( !$this->queued ) {
return;
}
if ( !$this->queued ) {
return;
}
@@
-137,7
+137,7
@@
class ExtensionRegistry {
$cache = new EmptyBagOStuff();
}
// See if this queue is in APC
$cache = new EmptyBagOStuff();
}
// See if this queue is in APC
- $key =
wfMemc
Key(
+ $key =
$cache->make
Key(
'registration',
md5( json_encode( $this->queued + $versions ) )
);
'registration',
md5( json_encode( $this->queued + $versions ) )
);
@@
-151,7
+151,10
@@
class ExtensionRegistry {
// did that, but it should be cached
$data['globals']['wgAutoloadClasses'] += $data['autoload'];
unset( $data['autoload'] );
// did that, but it should be cached
$data['globals']['wgAutoloadClasses'] += $data['autoload'];
unset( $data['autoload'] );
- $cache->set( $key, $data, 60 * 60 * 24 );
+ if ( !( $data['warnings'] && $wgDevelopmentWarnings ) ) {
+ // If there were no warnings that were shown, cache it
+ $cache->set( $key, $data, 60 * 60 * 24 );
+ }
}
$this->queued = [];
}
}
$this->queued = [];
}
@@
-198,6
+201,7
@@
class ExtensionRegistry {
$versionChecker = new VersionChecker( $wgVersion );
$extDependencies = [];
$incompatible = [];
$versionChecker = new VersionChecker( $wgVersion );
$extDependencies = [];
$incompatible = [];
+ $warnings = false;
foreach ( $queue as $path => $mtime ) {
$json = file_get_contents( $path );
if ( $json === false ) {
foreach ( $queue as $path => $mtime ) {
$json = file_get_contents( $path );
if ( $json === false ) {
@@
-209,6
+213,11
@@
class ExtensionRegistry {
}
if ( !isset( $info['manifest_version'] ) ) {
}
if ( !isset( $info['manifest_version'] ) ) {
+ wfDeprecated(
+ "{$info['name']}'s extension.json or skin.json does not have manifest_version",
+ '1.29'
+ );
+ $warnings = true;
// For backwards-compatability, assume a version of 1
$info['manifest_version'] = 1;
}
// For backwards-compatability, assume a version of 1
$info['manifest_version'] = 1;
}
@@
-237,6
+246,7
@@
class ExtensionRegistry {
$processor->extractInfo( $path, $info, $version );
}
$data = $processor->getExtractedInfo();
$processor->extractInfo( $path, $info, $version );
}
$data = $processor->getExtractedInfo();
+ $data['warnings'] = $warnings;
// check for incompatible extensions
$incompatible = array_merge(
// check for incompatible extensions
$incompatible = array_merge(
@@
-390,7
+400,7
@@
class ExtensionRegistry {
protected function processAutoLoader( $dir, array $info ) {
if ( isset( $info['AutoloadClasses'] ) ) {
// Make paths absolute, relative to the JSON file
protected function processAutoLoader( $dir, array $info ) {
if ( isset( $info['AutoloadClasses'] ) ) {
// Make paths absolute, relative to the JSON file
- return array_map( function( $file ) use ( $dir ) {
+ return array_map( function
( $file ) use ( $dir ) {
return "$dir/$file";
}, $info['AutoloadClasses'] );
} else {
return "$dir/$file";
}, $info['AutoloadClasses'] );
} else {