Skip to content
This repository
Browse code

ENHANCEMENT: Change PHP version requirements. Part of #7131.

  • Loading branch information...
commit 8b0dafb30d51573a0d195acf5676314b4c815d3a 1 parent 0fd7ce6
Robert Curry authored
9  dev/install/install.php
@@ -4,19 +4,16 @@
4 4
  ************************************************************************************
5 5
  **                                                                                **
6 6
  **  If you can read this text in your browser then you don't have PHP installed.  **
7  
- **  Please install PHP 5.3 or higher.                                             **
  7
+ **  Please install PHP 5.3.2 or higher, preferably PHP 5.3.10.                    **
8 8
  **                                                                                **
9 9
  ************************************************************************************
10 10
  ************************************************************************************/
11 11
 
12 12
 /**
13  
- * PHP version check. Make sure we've got at least PHP 5.3 in the most friendly way possible
  13
+ * PHP version check. Make sure we've got at least PHP 5.3.2 in the most friendly way possible
14 14
  */
15 15
 
16  
-$majorVersion = strtok(phpversion(),'.');
17  
-$minorVersion = strtok('.');
18  
-
19  
-if($majorVersion < 5 || ($majorVersion == 5 && $minorVersion < 3)) {
  16
+if (version_compare(phpversion(), '5.3.2', '<')) {
20 17
 	header("HTTP/1.1 500 Server Error");
21 18
 	echo str_replace('$PHPVersion', phpversion(), file_get_contents("sapphire/dev/install/php5-required.html"));
22 19
 	die();
4  dev/install/install.php5
@@ -4,7 +4,7 @@
4 4
  ************************************************************************************
5 5
  **                                                                                **
6 6
  **  If you can read this text in your browser then you don't have PHP installed.  **
7  
- **  Please install PHP 5.3 or higher.                                             **
  7
+ **  Please install PHP 5.3.2 or higher, preferably PHP 5.3.10.                    **
8 8
  **                                                                                **
9 9
  ************************************************************************************
10 10
  ************************************************************************************/
@@ -325,7 +325,7 @@ class InstallRequirements {
325 325
 		$isIIS = $this->isIIS(7);
326 326
 		$webserver = $this->findWebserver();
327 327
 
328  
-		$this->requirePHPVersion('5.3.0', '5.2.0', array("PHP Configuration", "PHP5 installed", null, "PHP version " . phpversion()));
  328
+		$this->requirePHPVersion('5.3.10', '5.3.2', array("PHP Configuration", "PHP5 installed", null, "PHP version " . phpversion()));
329 329
 
330 330
 		// Check that we can identify the root folder successfully
331 331
 		$this->requireFile('sapphire/dev/install/config-form.html', array("File permissions",
10  dev/install/php5-required.html
... ...
@@ -1,18 +1,18 @@
1 1
 <html>
2 2
 	<head>
3  
-		<title>PHP 5.3 is required</title>
  3
+		<title>PHP 5.3.2 is required</title>
4 4
 		<link rel="stylesheet" type="text/css" href="sapphire/dev/install/css/install.css">
5 5
 	</head>
6 6
 	<body>
7 7
 		<div id="BgContainer">
8 8
 			<div id="Container">
9 9
 				<div id="Header">
10  
-					<h1>PHP 5.3 required</h1>
  10
+					<h1>PHP 5.3.2 required</h1>
11 11
 					<div class="left">
12  
-						<h3>To run SilverStripe, please install PHP 5.3 or greater.</h3>
  12
+						<h3>To run SilverStripe, please install PHP 5.3.2 or greater.</h3>
13 13
 
14  
-						<p>We have detected that you are running PHP version <b>$PHPVersion</b>.  In order to run SilverStripe,
15  
-						you must have PHP version 5.3 or greater, and for best results we recommend PHP 5.3.8 or greater.<p/>
  14
+						<p>We have detected that you are running PHP version <b>$PHPVersion</b>. In order to run SilverStripe,
  15
+						you must have PHP version 5.3.2 or greater, and for best results we recommend PHP 5.3.10 or greater.<p/>
16 16
 
17 17
 						<p>If you are running on a shared host, you may need to ask your hosting provider how to do this.</p>
18 18
 					</div>
6  main.php
@@ -4,7 +4,7 @@
4 4
  ************************************************************************************
5 5
  **                                                                                **
6 6
  **  If you can read this text in your browser then you don't have PHP installed.  **
7  
- **  Please install PHP 5.3 or higher.                                             **
  7
+ **  Please install PHP 5.3.2 or higher, preferably PHP 5.3.10.                    **
8 8
  **                                                                                **
9 9
  ************************************************************************************
10 10
  ************************************************************************************/
@@ -13,10 +13,8 @@
13 13
  * @package sapphire
14 14
  * @subpackage core
15 15
  */
16  
-$majorVersion = strtok(phpversion(),'.');
17  
-$minorVersion = strtok('.');
18 16
 
19  
-if($majorVersion < 5 || ($majorVersion == 5 && $minorVersion < 3)) {
  17
+if (version_compare(phpversion(), '5.3.2', '<')) {
20 18
 	header("HTTP/1.1 500 Server Error");
21 19
 	echo str_replace('$PHPVersion', phpversion(), file_get_contents("dev/install/php5-required.html"));
22 20
 	die();

0 notes on commit 8b0dafb

Please sign in to comment.
Something went wrong with that request. Please try again.