Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/208821

Change subject: Make json_encode() options backward-compatible with PHP 5.3
......................................................................

Make json_encode() options backward-compatible with PHP 5.3

We should really upgrade the few remaining hosts that are still on PHP 5.3.
In the meantime, pass a literal value of 448 as $options for json_encode(),
equivalent to JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | 
JSON_UNESCAPED_UNICODE,
but doesn't break on PHP 5.3. This way we don't have to remember to flip it
back once tin is upgraded.

Change-Id: Iabaaf0e50a8f2e00c22cff6033c24daf29d9e78c
---
M multiversion/MWWikiversions.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/21/208821/1

diff --git a/multiversion/MWWikiversions.php b/multiversion/MWWikiversions.php
index c3e83af..8030436 100644
--- a/multiversion/MWWikiversions.php
+++ b/multiversion/MWWikiversions.php
@@ -28,7 +28,9 @@
         * @param array $wikis Array of wikis array( dbname => version )
         */
        public static function writeWikiVersionsFile( $path, $wikis ) {
-               $json = json_encode( $wikis, JSON_PRETTY_PRINT | 
JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE );
+               // 448 == JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | 
JSON_UNESCAPED_UNICODE,
+               // but doesn't break on PHP 5.3, which does not have these 
defined.
+               $json = json_encode( $wikis, 448 );
                if ( !file_put_contents( $path, $json, LOCK_EX ) ) {
                        print "Unable to write to $path.\n";
                        exit( 1 );

-- 
To view, visit https://gerrit.wikimedia.org/r/208821
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iabaaf0e50a8f2e00c22cff6033c24daf29d9e78c
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to