partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit d6ff70afa64eb8da425c0223214ffa68709fb382
parent 1b1aebfd3d344a87b0bc78fc5baf6c74440893f6
Author: Felicitus <felicitus@felicitus.org>
Date:   Sun,  6 Dec 2015 13:41:18 +0100

If PHP Version is 7.0 or higher it's not required to check opcache.save_comments and opcache.load_comments. Related to #521

Diffstat:
Mapp/PartKeeprRequirements.php | 23+++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/app/PartKeeprRequirements.php b/app/PartKeeprRequirements.php @@ -44,7 +44,8 @@ class PartKeeprRequirements extends SymfonyRequirements ini_get("max_execution_time") > 30, true, sprintf('Maximum Execution Time might be too low'), - sprintf('Your maximum execution time is set to %d seconds, which might be too low for low-end systems. If you encounter problems, please increase the value.', ini_get("max_execution_time")) + sprintf('Your maximum execution time is set to %d seconds, which might be too low for low-end systems. If you encounter problems, please increase the value.', + ini_get("max_execution_time")) ); $this->addRequirement( @@ -54,15 +55,17 @@ class PartKeeprRequirements extends SymfonyRequirements ); if (ini_get("opcache.enable")) { - $this->addPhpIniRequirement("opcache.save_comments", 1, - false, - "opcache.save_comments must be on", - sprintf("The php.ini opcache.save_comments directive must be set to 1.")); - - $this->addPhpIniRequirement("opcache.load_comments", 1, - false, - "opcache.load_comments must be on", - sprintf("The php.ini opcache.load_comments directive must be set to 1.")); + if (version_compare(phpversion(), "7.0", "<")) { + $this->addPhpIniRequirement("opcache.save_comments", 1, + false, + "opcache.save_comments must be on", + sprintf("The php.ini opcache.save_comments directive must be set to 1.")); + + $this->addPhpIniRequirement("opcache.load_comments", 1, + false, + "opcache.load_comments must be on", + sprintf("The php.ini opcache.load_comments directive must be set to 1.")); + } } }