mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Remove checks for PHP < 5.3.2, as it's no longer supported
This commit is contained in:
parent
cc7a012139
commit
14c0796617
@ -331,18 +331,15 @@ class SS_ClassManifest {
|
||||
|
||||
if (!$classes) {
|
||||
$tokens = token_get_all($file);
|
||||
if(version_compare(PHP_VERSION, '5.3', '>=')) {
|
||||
$classes = self::get_namespaced_class_parser()->findAll($tokens);
|
||||
$namespace = self::get_namespace_parser()->findAll($tokens);
|
||||
if($namespace) {
|
||||
$namespace = implode('', $namespace[0]['namespaceName']) . '\\';
|
||||
} else {
|
||||
$namespace = '';
|
||||
}
|
||||
|
||||
$classes = self::get_namespaced_class_parser()->findAll($tokens);
|
||||
$namespace = self::get_namespace_parser()->findAll($tokens);
|
||||
if($namespace) {
|
||||
$namespace = implode('', $namespace[0]['namespaceName']) . '\\';
|
||||
} else {
|
||||
$classes = self::get_class_parser()->findAll($tokens);
|
||||
$namespace = '';
|
||||
}
|
||||
|
||||
$interfaces = self::get_interface_parser()->findAll($tokens);
|
||||
|
||||
$cache = array('classes' => $classes, 'interfaces' => $interfaces, 'namespace' => $namespace);
|
||||
|
@ -21,11 +21,8 @@ class RandomGenerator {
|
||||
|
||||
// TODO Fails with "Could not gather sufficient random data" on IIS, temporarily disabled on windows
|
||||
if(!$isWin) {
|
||||
// mcrypt with urandom is only available on PHP 5.3 or newer
|
||||
if(version_compare(PHP_VERSION, '5.3.0', '>=') && function_exists('mcrypt_create_iv')) {
|
||||
$e = mcrypt_create_iv(64, MCRYPT_DEV_URANDOM);
|
||||
if($e !== false) return $e;
|
||||
}
|
||||
$e = mcrypt_create_iv(64, MCRYPT_DEV_URANDOM);
|
||||
if($e !== false) return $e;
|
||||
}
|
||||
|
||||
// Fall back to SSL methods - may slow down execution by a few ms
|
||||
|
@ -13,10 +13,6 @@ class NamespacedClassManifestTest extends SapphireTest {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
if(version_compare(PHP_VERSION, '5.3', '<')) {
|
||||
$this->markTestSkipped('Namespaces are not supported before PHP 5.3');
|
||||
}
|
||||
|
||||
$this->base = dirname(__FILE__) . '/fixtures/namespaced_classmanifest';
|
||||
$this->manifest = new SS_ClassManifest($this->base, false, true, false);
|
||||
}
|
||||
|
@ -122,9 +122,6 @@ PHP
|
||||
}
|
||||
|
||||
function testNamesapcedClassDefParser() {
|
||||
if(version_compare(PHP_VERSION, '5.3', '<')) {
|
||||
return;
|
||||
}
|
||||
$parser = SS_ClassManifest::get_namespaced_class_parser();
|
||||
|
||||
$tokens = $this->getNamespaceTokens();
|
||||
@ -167,9 +164,6 @@ PHP
|
||||
}
|
||||
|
||||
function testNamespaceDefParser() {
|
||||
if(version_compare(PHP_VERSION, '5.3', '<')) {
|
||||
return;
|
||||
}
|
||||
$parser = SS_ClassManifest::get_namespace_parser();
|
||||
|
||||
$namespacedTokens = $this->getNamespaceTokens();
|
||||
|
Loading…
Reference in New Issue
Block a user