X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=var%2FSymfonyRequirements.php;h=4a1fcc62128bd873f3096e4899e147c96fc050b6;hb=a29a15c98da1ffa78f7cc52e7906b904fcffc144;hp=7e7723af3180037f9311d0d99394c8f6751d5adf;hpb=99731f0bb1f6fd2815eeb9af504ce86df927657b;p=github%2Fwallabag%2Fwallabag.git
diff --git a/var/SymfonyRequirements.php b/var/SymfonyRequirements.php
index 7e7723af..4a1fcc62 100644
--- a/var/SymfonyRequirements.php
+++ b/var/SymfonyRequirements.php
@@ -389,7 +389,7 @@ class SymfonyRequirements extends RequirementCollection
{
/* mandatory requirements follow */
- $installedPhpVersion = phpversion();
+ $installedPhpVersion = PHP_VERSION;
$requiredPhpVersion = $this->getPhpRequiredVersion();
$this->addRecommendation(
@@ -448,15 +448,8 @@ class SymfonyRequirements extends RequirementCollection
}
if (false !== $requiredPhpVersion && version_compare($installedPhpVersion, $requiredPhpVersion, '>=')) {
- $timezones = array();
- foreach (DateTimeZone::listAbbreviations() as $abbreviations) {
- foreach ($abbreviations as $abbreviation) {
- $timezones[$abbreviation['timezone_id']] = true;
- }
- }
-
$this->addRequirement(
- isset($timezones[@date_default_timezone_get()]),
+ in_array(@date_default_timezone_get(), DateTimeZone::listIdentifiers(), true),
sprintf('Configured default timezone "%s" must be supported by your installation of PHP', @date_default_timezone_get()),
'Your default timezone is not supported by PHP. Check for typos in your php.ini file and have a look at the list of deprecated timezones at http://php.net/manual/en/timezones.others.php.'
);
@@ -633,12 +626,6 @@ class SymfonyRequirements extends RequirementCollection
'Install and enable the mbstring extension.'
);
- $this->addRecommendation(
- function_exists('iconv'),
- 'iconv() should be available',
- 'Install and enable the iconv extension.'
- );
-
$this->addRecommendation(
function_exists('utf8_decode'),
'utf8_decode() should be available',
@@ -737,7 +724,7 @@ class SymfonyRequirements extends RequirementCollection
'Install and/or enable a PHP accelerator (highly recommended).'
);
- if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
+ if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
$this->addRecommendation(
$this->getRealpathCacheSize() >= 5 * 1024 * 1024,
'realpath_cache_size should be at least 5M in php.ini',
@@ -780,7 +767,11 @@ class SymfonyRequirements extends RequirementCollection
{
$size = ini_get('realpath_cache_size');
$size = trim($size);
- $unit = strtolower(substr($size, -1, 1));
+ $unit = '';
+ if (!ctype_digit($size)) {
+ $unit = strtolower(substr($size, -1, 1));
+ $size = (int) substr($size, 0, -1);
+ }
switch ($unit) {
case 'g':
return $size * 1024 * 1024 * 1024;