Skip to content
This repository
Browse code

MINOR: Remove checks for PHP < 5.3.2, as it's no longer supported

  • Loading branch information...
commit 14c079661774ca5e3e0509952cf285350652ba9a 1 parent cc7a012
Andrew O'Neil authored April 18, 2012
15  core/manifest/ClassManifest.php
@@ -331,18 +331,15 @@ public function handleFile($basename, $pathname, $depth) {
331 331
 
332 332
 		if (!$classes) {
333 333
 			$tokens     = token_get_all($file);
334  
-			if(version_compare(PHP_VERSION, '5.3', '>=')) {
335  
-				$classes = self::get_namespaced_class_parser()->findAll($tokens);
336  
-				$namespace = self::get_namespace_parser()->findAll($tokens);
337  
-				if($namespace) {
338  
-					$namespace = implode('', $namespace[0]['namespaceName']) . '\\';
339  
-				} else {
340  
-					$namespace = '';
341  
-				}
  334
+			
  335
+			$classes = self::get_namespaced_class_parser()->findAll($tokens);
  336
+			$namespace = self::get_namespace_parser()->findAll($tokens);
  337
+			if($namespace) {
  338
+				$namespace = implode('', $namespace[0]['namespaceName']) . '\\';
342 339
 			} else {
343  
-				$classes = self::get_class_parser()->findAll($tokens);
344 340
 				$namespace = '';
345 341
 			}
  342
+
346 343
 			$interfaces = self::get_interface_parser()->findAll($tokens);
347 344
 
348 345
 			$cache = array('classes' => $classes, 'interfaces' => $interfaces, 'namespace' => $namespace);
7  security/RandomGenerator.php
@@ -21,11 +21,8 @@ function generateEntropy() {
21 21
 		
22 22
 		// TODO Fails with "Could not gather sufficient random data" on IIS, temporarily disabled on windows
23 23
 		if(!$isWin) {
24  
-			// mcrypt with urandom is only available on PHP 5.3 or newer
25  
-			if(version_compare(PHP_VERSION, '5.3.0', '>=') && function_exists('mcrypt_create_iv')) {
26  
-				$e = mcrypt_create_iv(64, MCRYPT_DEV_URANDOM);
27  
-				if($e !== false) return $e;
28  
-			}
  24
+			$e = mcrypt_create_iv(64, MCRYPT_DEV_URANDOM);
  25
+			if($e !== false) return $e;
29 26
 		}
30 27
 
31 28
 		// Fall back to SSL methods - may slow down execution by a few ms
4  tests/core/manifest/NamespacedClassManifestTest.php
@@ -13,10 +13,6 @@ class NamespacedClassManifestTest extends SapphireTest {
13 13
 	public function setUp() {
14 14
 		parent::setUp();
15 15
 		
16  
-		if(version_compare(PHP_VERSION, '5.3', '<')) {
17  
-			$this->markTestSkipped('Namespaces are not supported before PHP 5.3');
18  
-		}
19  
-		
20 16
 		$this->base = dirname(__FILE__) . '/fixtures/namespaced_classmanifest';
21 17
 		$this->manifest      = new SS_ClassManifest($this->base, false, true, false);
22 18
 	}
6  tests/core/manifest/TokenisedRegularExpressionTest.php
@@ -122,9 +122,6 @@ function testClassDefParser() {
122 122
 	}
123 123
 	
124 124
 	function testNamesapcedClassDefParser() {
125  
-		if(version_compare(PHP_VERSION, '5.3', '<')) {
126  
-			return;
127  
-		}
128 125
 		$parser = SS_ClassManifest::get_namespaced_class_parser();
129 126
 		
130 127
 		$tokens = $this->getNamespaceTokens();
@@ -167,9 +164,6 @@ function testInterfaceDefParser() {
167 164
 	}
168 165
 	
169 166
 	function testNamespaceDefParser() {
170  
-		if(version_compare(PHP_VERSION, '5.3', '<')) {
171  
-			return;
172  
-		}
173 167
 		$parser = SS_ClassManifest::get_namespace_parser();
174 168
 		
175 169
 		$namespacedTokens = $this->getNamespaceTokens();

0 notes on commit 14c0796

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