29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-27 07:33:41 +00:00

Raise the minimum requirements to PHP 5.3.1 and drop legacy code.

This commit is contained in:
Rouven Weßling 2012-06-28 20:03:31 +02:00
parent 10a1663313
commit 93352d2559
7 changed files with 16 additions and 59 deletions

View File

@ -83,39 +83,13 @@ class LanguagesHelper
return array();
}
// Capture hidden PHP errors from the parsing
$version = phpversion();
$php_errormsg = null;
$track_errors = ini_get('track_errors');
ini_set('track_errors', true);
$contents = file_get_contents($filename);
$contents = str_replace('_QQ_', '"\""', $contents);
$strings = @parse_ini_string($contents);
if ($version >= '5.3.1')
if ($strings === false)
{
$contents = file_get_contents($filename);
$contents = str_replace('_QQ_', '"\""', $contents);
$strings = @parse_ini_string($contents);
if ($strings === false)
{
return array();
}
}
else
{
$strings = @parse_ini_file($filename);
if ($strings === false)
{
return array();
}
if ($version == '5.3.0' && is_array($strings))
{
foreach ($strings as $key => $string)
{
$strings[$key] = str_replace('_QQ_', '"', $string);
}
}
return array();
}
return $strings;

View File

@ -13,7 +13,6 @@ defined('_JEXEC') or die;
*/
@ini_set('magic_quotes_runtime', 0);
@ini_set('zend.ze1_compatibility_mode', '0');
/*
* Installation check, and check on removal of the install directory.

View File

@ -13,7 +13,6 @@ defined('_JEXEC') or die;
//
@ini_set('magic_quotes_runtime', 0);
@ini_set('zend.ze1_compatibility_mode', '0');
//
// Installation check, and check on removal of the install directory.

View File

@ -5,9 +5,9 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// PHP 5 check
if (version_compare(PHP_VERSION, '5.2.4', '<')) {
die('Your host needs to use PHP 5.2.4 or higher to run this version of Joomla!');
if (version_compare(PHP_VERSION, '5.3.1', '<'))
{
die('Your host needs to use PHP 5.3.1 or higher to run this version of Joomla!');
}
/**
@ -40,7 +40,6 @@ define('JPATH_MANIFESTS', JPATH_ADMINISTRATOR . '/manifests');
*/
error_reporting(E_ALL);
@ini_set('magic_quotes_runtime', 0);
@ini_set('zend.ze1_compatibility_mode', '0');
/*
* Check for existing configuration file.

View File

@ -194,19 +194,10 @@ class JInstallationModelSetup extends JModelLegacy
$disabled_functions[$i] = trim($disabled_functions[$i]);
}
if (phpversion() >= '5.3.0') {
$result = !in_array('parse_ini_string', $disabled_functions);
} else {
$result = !in_array('parse_ini_file', $disabled_functions);
}
$result = !in_array('parse_ini_string', $disabled_functions);
} else {
// Attempt to detect their existence; even pure PHP implementation of them will trigger a positive response, though.
if (phpversion() >= '5.3.0') {
$result = function_exists('parse_ini_string');
} else {
$result = function_exists('parse_ini_file');
}
$result = function_exists('parse_ini_string');
}
return $result;
@ -225,8 +216,8 @@ class JInstallationModelSetup extends JModelLegacy
// Check the PHP Version.
$option = new stdClass;
$option->label = JText::_('INSTL_PHP_VERSION').' >= 5.2.4';
$option->state = version_compare(PHP_VERSION, '5.2.4', '>=');
$option->label = JText::_('INSTL_PHP_VERSION').' >= 5.3.1';
$option->state = version_compare(PHP_VERSION, '5.3.1', '>=');
$option->notice = null;
$options[] = $option;

View File

@ -277,15 +277,11 @@ class plgFinderCategories extends FinderIndexerAdapter
// Build the necessary route and path information.
$item->url = $this->getURL($item->id, $item->extension, $this->layout);
if (class_exists($extension . 'HelperRoute') && method_exists($extension . 'HelperRoute', 'getCategoryRoute'))
$class = $extension . 'HelperRoute';
if (class_exists($class) && method_exists($class, 'getCategoryRoute'))
{
$class = $extension . 'HelperRoute';
// This is necessary for PHP 5.2 compatibility
$item->route = call_user_func(array($class, 'getCategoryRoute'), $item->id);
// Use this when PHP 5.3 is minimum supported
//$item->route = $class::getCategoryRoute($item->id);
$item->route = $class::getCategoryRoute($item->id);
}
else
{

View File

@ -38,7 +38,6 @@ if (!defined('JPATH_TESTS'))
// Maximise error reporting.
@ini_set('zend.ze1_compatibility_mode', '0');
error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start();