Paladox has uploaded a new change for review.

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

Change subject: Fix php check
......................................................................

Fix php check

* This fixes the php check when starting mediawiki.

* It would cause it to fail thinking you had incompatible php version.

* This problem only happended if you had mutiple php version installed or
* if you were on a shared hosting server with mutiple php installed to
* choose from the check would think you had php 5.2 when you doint.

Change-Id: I7ae0369e4bab279d5e1bc754fe1a0bc8543bb2ed
---
M api.php
M index.php
M load.php
M maintenance/Maintenance.php
M mw-config/index.php
5 files changed, 20 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/17/222917/1

diff --git a/api.php b/api.php
index af7c452..2baffbf 100644
--- a/api.php
+++ b/api.php
@@ -37,8 +37,10 @@
 
 // Bail on old versions of PHP, or if composer has not been run yet to install
 // dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
-wfEntryPointCheck( 'api.php' );
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, 
'5.3.3' ) < 0 ) {
+       require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
+       wfEntryPointCheck( 'api.php' );
+}
 
 require __DIR__ . '/includes/WebStart.php';
 
diff --git a/index.php b/index.php
index 67bd0c9..b667e57 100644
--- a/index.php
+++ b/index.php
@@ -32,8 +32,10 @@
 
 // Bail on old versions of PHP, or if composer has not been run yet to install
 // dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
-wfEntryPointCheck( 'index.php' );
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, 
'5.3.3' ) < 0 ) {
+       require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
+       wfEntryPointCheck( 'index.php' );
+}
 
 require __DIR__ . '/includes/WebStart.php';
 
diff --git a/load.php b/load.php
index 22f62fe..ffd1fd7 100644
--- a/load.php
+++ b/load.php
@@ -26,8 +26,10 @@
 
 // Bail on old versions of PHP, or if composer has not been run yet to install
 // dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
-wfEntryPointCheck( 'load.php' );
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, 
'5.3.3' ) < 0 ) {
+       require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
+       wfEntryPointCheck( 'load.php' );
+}
 
 require __DIR__ . '/includes/WebStart.php';
 
diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php
index 04aa3a5..344bbca 100644
--- a/maintenance/Maintenance.php
+++ b/maintenance/Maintenance.php
@@ -22,8 +22,10 @@
 
 // Bail on old versions of PHP, or if composer has not been run yet to install
 // dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
-wfEntryPointCheck( 'cli' );
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, 
'5.3.3' ) < 0 ) {
+       require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
+       wfEntryPointCheck( 'cli' );
+}
 
 /**
  * @defgroup MaintenanceArchive Maintenance archives
diff --git a/mw-config/index.php b/mw-config/index.php
index be811dc..3fc5c2c 100644
--- a/mw-config/index.php
+++ b/mw-config/index.php
@@ -22,8 +22,10 @@
 
 // Bail on old versions of PHP, or if composer has not been run yet to install
 // dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
-wfEntryPointCheck( 'mw-config/index.php' );
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, 
'5.3.3' ) < 0 ) {
+       require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
+       wfEntryPointCheck( 'mw-config/index.php' );
+}
 
 define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
 define( 'MEDIAWIKI_INSTALL', true );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ae0369e4bab279d5e1bc754fe1a0bc8543bb2ed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com>

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

Reply via email to