MINOR Update docs and version checking for PHP 5.3+

This commit is contained in:
Sean Harvey 2012-03-31 20:09:45 +13:00 committed by Sean Harvey
parent 58e912d4d7
commit 68aaae8cc0
5 changed files with 13 additions and 14 deletions

View File

@ -42,8 +42,6 @@ Director::addRules(20, array(
Object::useCustomClass('SSDatetime', 'SS_Datetime', true); Object::useCustomClass('SSDatetime', 'SS_Datetime', true);
Object::useCustomClass('Datetime', 'SS_Datetime', true); Object::useCustomClass('Datetime', 'SS_Datetime', true);
/** /**
* The root directory of TinyMCE * The root directory of TinyMCE
*/ */

View File

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

View File

@ -4,7 +4,7 @@
************************************************************************************ ************************************************************************************
** ** ** **
** If you can read this text in your browser then you don't have PHP installed. ** ** If you can read this text in your browser then you don't have PHP installed. **
** Please install PHP 5.2 or higher, preferably PHP 5.3. ** ** Please install PHP 5.3 or higher. **
** ** ** **
************************************************************************************ ************************************************************************************
************************************************************************************/ ************************************************************************************/

View File

@ -11,7 +11,6 @@
<div id="Container"> <div id="Container">
<div id="Header"> <div id="Header">
<h1>SilverStripe CMS Installation</h1> <h1>SilverStripe CMS Installation</h1>
</div> </div>
<div id="Navigation">&nbsp;</div> <div id="Navigation">&nbsp;</div>
@ -20,10 +19,10 @@
<div id="Layout"> <div id="Layout">
<div class="typography"> <div class="typography">
<h1>PHP 5 required</h1> <h1>PHP 5 required</h1>
<h2>To run SilverStripe, please install PHP 5.2 or greater.</h2> <h2>To run SilverStripe, please install PHP 5.3 or greater.</h2>
<p>We have detected that you are running PHP version <b>$PHPVersion</b>. In order to run SilverStripe, <p>We have detected that you are running PHP version <b>$PHPVersion</b>. In order to run SilverStripe,
you must have PHP version 5.2 or greater, and for best results we recommend PHP 5.3 or greater.</p> you must have PHP version 5.3 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> <p>If you are running on a shared host, you may need to ask your hosting provider how to do this.</p>
</div> </div>
@ -37,4 +36,4 @@
</div> </div>
</div> </div>
</body> </body>
</html> </html>

View File

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