Merge pull request #312 from robert-h-curry/7131-php-version-requirement

ENHANCEMENT: Change PHP version requirements. Part of #7131.
This commit is contained in:
Sean Harvey 2012-04-12 18:33:25 -07:00
commit 6d9732435d
4 changed files with 12 additions and 17 deletions

View File

@ -4,19 +4,16 @@
************************************************************************************
** **
** If you can read this text in your browser then you don't have PHP installed. **
** Please install PHP 5.3 or higher. **
** Please install PHP 5.3.2 or higher, preferably PHP 5.3.10. **
** **
************************************************************************************
************************************************************************************/
/**
* PHP version check. Make sure we've got at least PHP 5.3 in the most friendly way possible
* PHP version check. Make sure we've got at least PHP 5.3.2 in the most friendly way possible
*/
$majorVersion = strtok(phpversion(),'.');
$minorVersion = strtok('.');
if($majorVersion < 5 || ($majorVersion == 5 && $minorVersion < 3)) {
if (version_compare(phpversion(), '5.3.2', '<')) {
header("HTTP/1.1 500 Server Error");
echo str_replace('$PHPVersion', phpversion(), file_get_contents("sapphire/dev/install/php5-required.html"));
die();

View File

@ -4,7 +4,7 @@
************************************************************************************
** **
** If you can read this text in your browser then you don't have PHP installed. **
** Please install PHP 5.3 or higher. **
** Please install PHP 5.3.2 or higher, preferably PHP 5.3.10. **
** **
************************************************************************************
************************************************************************************/
@ -325,7 +325,7 @@ class InstallRequirements {
$isIIS = $this->isIIS(7);
$webserver = $this->findWebserver();
$this->requirePHPVersion('5.3.0', '5.2.0', array("PHP Configuration", "PHP5 installed", null, "PHP version " . phpversion()));
$this->requirePHPVersion('5.3.10', '5.3.2', array("PHP Configuration", "PHP5 installed", null, "PHP version " . phpversion()));
// Check that we can identify the root folder successfully
$this->requireFile('sapphire/dev/install/config-form.html', array("File permissions",

View File

@ -1,18 +1,18 @@
<html>
<head>
<title>PHP 5.3 is required</title>
<title>PHP 5.3.2 is required</title>
<link rel="stylesheet" type="text/css" href="sapphire/dev/install/css/install.css">
</head>
<body>
<div id="BgContainer">
<div id="Container">
<div id="Header">
<h1>PHP 5.3 required</h1>
<h1>PHP 5.3.2 required</h1>
<div class="left">
<h3>To run SilverStripe, please install PHP 5.3 or greater.</h3>
<h3>To run SilverStripe, please install PHP 5.3.2 or greater.</h3>
<p>We have detected that you are running PHP version <b>$PHPVersion</b>. In order to run SilverStripe,
you must have PHP version 5.3 or greater, and for best results we recommend PHP 5.3.8 or greater.<p/>
you must have PHP version 5.3.2 or greater, and for best results we recommend PHP 5.3.10 or greater.<p/>
<p>If you are running on a shared host, you may need to ask your hosting provider how to do this.</p>
</div>

View File

@ -4,7 +4,7 @@
************************************************************************************
** **
** If you can read this text in your browser then you don't have PHP installed. **
** Please install PHP 5.3 or higher. **
** Please install PHP 5.3.2 or higher, preferably PHP 5.3.10. **
** **
************************************************************************************
************************************************************************************/
@ -13,10 +13,8 @@
* @package sapphire
* @subpackage core
*/
$majorVersion = strtok(phpversion(),'.');
$minorVersion = strtok('.');
if($majorVersion < 5 || ($majorVersion == 5 && $minorVersion < 3)) {
if (version_compare(phpversion(), '5.3.2', '<')) {
header("HTTP/1.1 500 Server Error");
echo str_replace('$PHPVersion', phpversion(), file_get_contents("dev/install/php5-required.html"));
die();