$processor = new ReflectionClass( 'ExtensionProcessor' );
$settings = $processor->getProperty( 'globalSettings' );
$settings->setAccessible( true );
- return $settings->getValue() + $this->formerGlobals;
+ return array_merge( $settings->getValue(), $this->formerGlobals );
}
public function execute() {
unset( $var );
$arg = $this->getArg( 0 );
if ( !is_file( $arg ) ) {
- $this->error( "$arg is not a file.", true );
+ $this->fatalError( "$arg is not a file." );
}
require $arg;
unset( $arg );
protected function handleExtensionFunctions( $realName, $value ) {
foreach ( $value as $func ) {
if ( $func instanceof Closure ) {
- $this->error( "Error: Closures cannot be converted to JSON. " .
- "Please move your extension function somewhere else.", 1
+ $this->fatalError( "Error: Closures cannot be converted to JSON. " .
+ "Please move your extension function somewhere else."
);
}
// check if $func exists in the global scope
if ( function_exists( $func ) ) {
- $this->error( "Error: Global functions cannot be converted to JSON. " .
- "Please move your extension function ($func) into a class.", 1
+ $this->fatalError( "Error: Global functions cannot be converted to JSON. " .
+ "Please move your extension function ($func) into a class."
);
}
}
public function handleHooks( $realName, $value ) {
foreach ( $value as $hookName => &$handlers ) {
+ if ( $hookName === 'UnitTestsList' ) {
+ $this->output( "Note: the UnitTestsList hook is no longer necessary as " .
+ "long as your tests are located in the \"tests/phpunit/\" directory. " .
+ "Please see <https://www.mediawiki.org/wiki/Manual:PHP_unit_testing/" .
+ "Writing_unit_tests_for_extensions#Register_your_tests> for more details.\n"
+ );
+ }
foreach ( $handlers as $func ) {
if ( $func instanceof Closure ) {
- $this->error( "Error: Closures cannot be converted to JSON. " .
- "Please move the handler for $hookName somewhere else.", 1
+ $this->fatalError( "Error: Closures cannot be converted to JSON. " .
+ "Please move the handler for $hookName somewhere else."
);
}
// Check if $func exists in the global scope
if ( function_exists( $func ) ) {
- $this->error( "Error: Global functions cannot be converted to JSON. " .
- "Please move the handler for $hookName inside a class.", 1
+ $this->fatalError( "Error: Global functions cannot be converted to JSON. " .
+ "Please move the handler for $hookName inside a class."
);
}
}