Skip to content

Commit

Permalink
Set proper required PHP version in AppRequirements (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierredup committed Aug 20, 2017
1 parent e410cb0 commit 00ea1cb
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions app/AppRequirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ class AppRequirements extends SymfonyRequirements

public function __construct()
{
$phpVersion = phpversion();
$icuVersion = Intl::getIcuVersion();

$this->addRequirement(
version_compare($phpVersion, self::REQUIRED_PHP_VERSION, '>='),
sprintf('PHP version must be at least %s (%s installed)', self::REQUIRED_PHP_VERSION, $phpVersion),
sprintf('You are running PHP version "<strong>%s</strong>", but CSBill needs at least PHP "<strong>%s</strong>" to run.
Before using CSBill, upgrade your PHP installation, preferably to the latest version.',
$phpVersion, self::REQUIRED_PHP_VERSION),
sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $phpVersion)
);

parent::__construct();

$this->addRequirement(
Expand All @@ -48,6 +36,8 @@ class_exists('Locale'),
'Install and enable the <strong>intl</strong> extension.'
);

$icuVersion = Intl::getIcuVersion();

$this->addRequirement(
null !== $icuVersion && version_compare($icuVersion, self::REQUIRED_ICU_VERSION, '>='),
'icu library must be at least '.self::REQUIRED_ICU_VERSION,
Expand Down Expand Up @@ -120,4 +110,9 @@ public function getRecommendations()

return $recommendations;
}

public function getPhpRequiredVersion()
{
return self::REQUIRED_PHP_VERSION;
}
}

0 comments on commit 00ea1cb

Please sign in to comment.