aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <aledeg@users.noreply.github.com> 2021-01-14 17:28:45 -0500
committerGravatar GitHub <noreply@github.com> 2021-01-14 23:28:45 +0100
commit29fe125b4a18f7107b50e54c69184c4f1777bbf6 (patch)
treed76446252588f6db51b50a697ff7649894817aa2 /lib
parente3457f7d7b56509048e3c1f53f05f278656e976c (diff)
Add constant for PHP requirements (#3369)
* Add constant for PHP requirements This new constant is used for PHP version check. This way, we won't forget to modify some part of the code base. * Remove PHP version checks Some checks were obsolete because they were checking unsupported PHP versions.
Diffstat (limited to 'lib')
-rw-r--r--lib/Minz/Mailer.php6
-rw-r--r--lib/lib_install.php2
-rw-r--r--lib/lib_rss.php6
3 files changed, 4 insertions, 10 deletions
diff --git a/lib/Minz/Mailer.php b/lib/Minz/Mailer.php
index 04392982b..b0de183e3 100644
--- a/lib/Minz/Mailer.php
+++ b/lib/Minz/Mailer.php
@@ -34,14 +34,8 @@ class Minz_Mailer {
/**
* Constructor.
- *
- * If PHP version is < 5.5, a warning is logged.
*/
public function __construct () {
- if (version_compare(PHP_VERSION, '5.5') < 0) {
- Minz_Log::warning('Minz_Mailer cannot be used with a version of PHP < 5.5.');
- }
-
$this->view = new Minz_View();
$this->view->_layout(false);
$this->view->attributeParams();
diff --git a/lib/lib_install.php b/lib/lib_install.php
index e67b3611c..19b3274e3 100644
--- a/lib/lib_install.php
+++ b/lib/lib_install.php
@@ -6,7 +6,7 @@ Minz_Configuration::register('default_system', join_path(FRESHRSS_PATH, 'config.
Minz_Configuration::register('default_user', join_path(FRESHRSS_PATH, 'config-user.default.php'));
function checkRequirements($dbType = '') {
- $php = version_compare(PHP_VERSION, '5.6.0') >= 0;
+ $php = version_compare(PHP_VERSION, FRESHRSS_MIN_PHP_VERSION) >= 0;
$curl = extension_loaded('curl');
$pdo_mysql = extension_loaded('pdo_mysql');
$pdo_sqlite = extension_loaded('pdo_sqlite');
diff --git a/lib/lib_rss.php b/lib/lib_rss.php
index 9afcc8636..aaa644faf 100644
--- a/lib/lib_rss.php
+++ b/lib/lib_rss.php
@@ -1,6 +1,6 @@
<?php
-if (version_compare(PHP_VERSION, '5.6.0', '<')) {
- die('FreshRSS error: FreshRSS requires PHP 5.6.0+!');
+if (version_compare(PHP_VERSION, FRESHRSS_MIN_PHP_VERSION, '<')) {
+ die(sprintf('FreshRSS error: FreshRSS requires PHP %s+!', FRESHRSS_MIN_PHP_VERSION));
}
if (!function_exists('mb_strcut')) {
@@ -416,7 +416,7 @@ function check_install_php() {
$pdo_pgsql = extension_loaded('pdo_pgsql');
$pdo_sqlite = extension_loaded('pdo_sqlite');
return array(
- 'php' => version_compare(PHP_VERSION, '5.5.0') >= 0,
+ 'php' => version_compare(PHP_VERSION, FRESHRSS_MIN_PHP_VERSION) >= 0,
'minz' => file_exists(LIB_PATH . '/Minz'),
'curl' => extension_loaded('curl'),
'pdo' => $pdo_mysql || $pdo_sqlite || $pdo_pgsql,