Seb35 has submitted this change and it was merged. Change subject: General maintenance ......................................................................
General maintenance * Updated minimal versions for MediaWiki (1.6) and PHP (5.2) found after testing * Updated script validating the schema for new version of justinrainbow/json-schema * Updated the config schema for a new key introduced previously ('deployments') * Fixed a bug caused by an missing variable Change-Id: I1bf8cc8587d89b68fa26fb4e6e55edeb28a73650 --- M composer.json M docs/farms-schema.json M extension.json M scripts/validate-schema.php M src/MediaWikiFarm.php 5 files changed, 16 insertions(+), 9 deletions(-) Approvals: Seb35: Verified; Looks good to me, approved diff --git a/composer.json b/composer.json index 0cbf2f2..7326a3a 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "license": "GPL-3.0+", "require": { - "php": ">=5.5", + "php": ">=5.2", "symfony/yaml": "^2.0 || ^3.0" }, "require-dev": { diff --git a/docs/farms-schema.json b/docs/farms-schema.json index 6b1d865..dca3e6a 100644 --- a/docs/farms-schema.json +++ b/docs/farms-schema.json @@ -56,7 +56,11 @@ }, "versions": { "type": "string", - "description": "File containing an array where each key is a wikiID and each value is the corresponding MediaWiki version." + "description": "File containing an array where each key is a wikiID and each value is the corresponding MediaWiki version. When a 'deployments' key is present, this file contains expected versions before the 'maintenance/update.php' script is run, actual versions after." + }, + "deployments": { + "type": "string", + "description": "File containing an array where each key is a wikiID and each value is the corresponding MediaWiki version similarly to 'versions', but this file contains actual versions, before and after the 'maintenance/update.php' script is run." }, "nonexistant": { "type": "string", diff --git a/extension.json b/extension.json index 15f80cf..0d8a7e4 100644 --- a/extension.json +++ b/extension.json @@ -9,7 +9,7 @@ "url": "https://www.mediawiki.org/wiki/Extension:MediaWikiFarm", "type": "other", "requires": { - "MediaWiki": ">= 1.1.0" + "MediaWiki": ">= 1.6.0" }, "config": { "MediaWikiFarmConfigDir": "/etc/mediawiki", diff --git a/scripts/validate-schema.php b/scripts/validate-schema.php index 5152af0..bf41119 100644 --- a/scripts/validate-schema.php +++ b/scripts/validate-schema.php @@ -13,9 +13,8 @@ foreach( array( 'config/farms.yml', 'config/farms.json', 'config/farms.php' ) as $filename ) { - // Get the schema and data as objects - $retriever = new JsonSchema\Uri\UriRetriever; - $schema = $retriever->retrieve('file://' . realpath('docs/farms-schema.json')); + if( !is_file( $filename ) ) + continue; echo "\n$filename:\n"; if( preg_match( '/\.yml$/', $filename ) ) { @@ -37,10 +36,14 @@ $data = json_decode( $dataJSON ); } + // Initialise objects + $resolver = new JsonSchema\Uri\UriResolver(); + $retriever = new JsonSchema\Uri\UriRetriever(); + // If you use $ref or if you are unsure, resolve those references here // This modifies the $schema object - $refResolver = new JsonSchema\RefResolver( $retriever ); - $refResolver->resolve( $schema, 'file://' . dirname( __FILE__ ) ); + $refResolver = new JsonSchema\RefResolver( $retriever, $resolver ); + $schema = $refResolver->resolve( 'file://' . realpath( 'docs/farms-schema.json' ) ); // Validate $validator = new JsonSchema\Validator(); diff --git a/src/MediaWikiFarm.php b/src/MediaWikiFarm.php index 810989f..53ab1f8 100644 --- a/src/MediaWikiFarm.php +++ b/src/MediaWikiFarm.php @@ -423,7 +423,7 @@ if( array_key_exists( 'redirect', $config ) ) { $redirects++; - return $this->selectFarm( $configs, $this->replaceVariables( $config['redirect'] ) ); + return $this->selectFarm( $farms, $this->replaceVariables( $config['redirect'] ) ); } # Get the selected configuration -- To view, visit https://gerrit.wikimedia.org/r/304069 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1bf8cc8587d89b68fa26fb4e6e55edeb28a73650 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MediaWikiFarm Gerrit-Branch: master Gerrit-Owner: Seb35 <seb35wikipe...@gmail.com> Gerrit-Reviewer: Seb35 <seb35wikipe...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits