Use PHP_VERSION constant instead of phpversion() function call
Change-Id: Ifb3d1bd92d6abaa561e7337b311b4cb10c38a2b6
This commit is contained in:
parent
11c67100ba
commit
a4334bbef5
10 changed files with 10 additions and 10 deletions
2
api.php
2
api.php
|
|
@ -34,7 +34,7 @@
|
|||
define( 'MW_API', true );
|
||||
|
||||
// Bail if PHP is too low
|
||||
if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
|
||||
if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
|
||||
// We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
|
||||
require dirname( __FILE__ ) . '/includes/PHPVersionError.php';
|
||||
wfPHPVersionError( 'api.php' );
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ function wfPHPVersionError( $type ) {
|
|||
$mwVersion = '1.24';
|
||||
$minimumVersionPHP = '5.3.2';
|
||||
|
||||
$phpVersion = phpversion();
|
||||
$phpVersion = PHP_VERSION;
|
||||
$protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';
|
||||
$message = "MediaWiki $mwVersion requires at least "
|
||||
. "PHP version $minimumVersionPHP, you are using PHP $phpVersion.";
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class ApiQuerySiteinfo extends ApiQueryBase {
|
|||
|
||||
$data['generator'] = "MediaWiki {$config->get( 'Version' )}";
|
||||
|
||||
$data['phpversion'] = phpversion();
|
||||
$data['phpversion'] = PHP_VERSION;
|
||||
$data['phpsapi'] = PHP_SAPI;
|
||||
$data['dbtype'] = $config->get( 'DBtype' );
|
||||
$data['dbversion'] = $this->getDB()->getServerVersion();
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ abstract class Installer {
|
|||
public function doEnvironmentChecks() {
|
||||
// Php version has already been checked by entry scripts
|
||||
// Show message here for information purposes
|
||||
$this->showMessage( 'config-env-php', phpversion() );
|
||||
$this->showMessage( 'config-env-php', PHP_VERSION );
|
||||
|
||||
$good = true;
|
||||
// Must go here because an old version of PCRE can prevent other checks from completing
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
# has structures (try/catch, foo()->bar(), etc etc) which throw parse errors in
|
||||
# PHP 4. Setup.php and ObjectCache.php have structures invalid in PHP 5.0 and
|
||||
# 5.1, respectively.
|
||||
if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
|
||||
if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
|
||||
// We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
|
||||
require dirname( __FILE__ ) . '/includes/PHPVersionError.php';
|
||||
wfPHPVersionError( 'index.php' );
|
||||
|
|
|
|||
2
load.php
2
load.php
|
|
@ -23,7 +23,7 @@
|
|||
*/
|
||||
|
||||
// Bail if PHP is too low
|
||||
if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
|
||||
if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
|
||||
// We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
|
||||
require dirname( __FILE__ ) . '/includes/PHPVersionError.php';
|
||||
wfPHPVersionError( 'load.php' );
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
* @ingroup Maintenance
|
||||
*/
|
||||
|
||||
if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '5.3.2' ) < 0 ) ) {
|
||||
if ( !function_exists( 'version_compare' ) || ( version_compare( PHP_VERSION, '5.3.2' ) < 0 ) ) {
|
||||
require_once dirname( __FILE__ ) . '/../includes/PHPVersionError.php';
|
||||
wfPHPVersionError( 'cli' );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
* @ingroup Maintenance
|
||||
*/
|
||||
|
||||
if ( !function_exists( 'version_compare' ) || ( version_compare( phpversion(), '5.3.2' ) < 0 ) ) {
|
||||
if ( !function_exists( 'version_compare' ) || ( version_compare( PHP_VERSION, '5.3.2' ) < 0 ) ) {
|
||||
require dirname( __FILE__ ) . '/../includes/PHPVersionError.php';
|
||||
wfPHPVersionError( 'cli' );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
// Bail if PHP is too low
|
||||
if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.3.2' ) < 0 ) {
|
||||
if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
|
||||
// We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
|
||||
require dirname( dirname( __FILE__ ) ) . '/includes/PHPVersionError.php';
|
||||
wfPHPVersionError( 'mw-config/index.php' );
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ class DbTestRecorder extends DbTestPreviewer {
|
|||
array(
|
||||
'tr_date' => $this->db->timestamp(),
|
||||
'tr_mw_version' => $this->version,
|
||||
'tr_php_version' => phpversion(),
|
||||
'tr_php_version' => PHP_VERSION,
|
||||
'tr_db_version' => $this->db->getServerVersion(),
|
||||
'tr_uname' => php_uname()
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue