jenkins-bot has submitted this change and it was merged.
Change subject: Make version compare to work with all deployment branches etc.
......................................................................
Make version compare to work with all deployment branches etc.
the following works with various test cases:
if ( !version_compare( '1.22alpha', '1.22c', '<' ) ) {
die( 1 );
}
$this->assertTrue( version_compare( '1.21wmf21', '1.22c', '<' ), '1.21wmf21 is
incompatible' );
$this->assertTrue( version_compare( '1.21.2', '1.22c', '<' ), '1.21.2 is
incompatible' );
$this->assertFalse( version_compare( '1.22wmf21', '1.22c', '<' ), '1.22wmf21 is
compatible' );
$this->assertFalse( version_compare( '1.22alpha', '1.22c', '<' ), '1.22alpha is
compatible' );
seems version_compare works in strange ways...
Change-Id: I23e3e052defe42c9ab2ee3be94e07766242853a8
---
M MobileFrontend.php
1 file changed, 7 insertions(+), 0 deletions(-)
Approvals:
MaxSem: Looks good to me, approved
jenkins-bot: Verified
diff --git a/MobileFrontend.php b/MobileFrontend.php
index 0aa1ed3..a01ac57 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -15,6 +15,13 @@
die( -1 );
}
+// Too many people are trying to use master MF with stable MediaWiki releases
+if ( version_compare( $wgVersion, '1.22c', '<' ) ) {
+ echo( "This version of MobileFrontend requires MediaWiki 1.22, you have
$wgVersion.
+You can download a more appropriate version from
https://www.mediawiki.org/wiki/Special:ExtensionDistributor/MobileFrontend\n" );
+ die( -1 );
+}
+
// Define the extension; allows us make sure the extension is used correctly
define( 'MOBILEFRONTEND', 'MobileFrontend' );
--
To view, visit https://gerrit.wikimedia.org/r/89040
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I23e3e052defe42c9ab2ee3be94e07766242853a8
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits