Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 
 
 

43 řádky
1.1 KiB

  1. <?php
  2. namespace Grav\Plugin\Problems;
  3. use Grav\Plugin\Problems\Base\Problem;
  4. /**
  5. * Class PHPVersion
  6. * @package Grav\Plugin\Problems
  7. */
  8. class PHPVersion extends Problem
  9. {
  10. public function __construct()
  11. {
  12. $this->id = 'PHP Minimum Version';
  13. $this->class = get_class($this);
  14. $this->order = 102;
  15. $this->level = Problem::LEVEL_CRITICAL;
  16. $this->status = false;
  17. $this->help = 'https://getgrav.org/blog/raising-php-requirements-2018';
  18. }
  19. /**
  20. * @return $this
  21. */
  22. public function process()
  23. {
  24. $min_php_version = defined('GRAV_PHP_MIN') ? GRAV_PHP_MIN : '5.6.4';
  25. $your_php_version = PHP_VERSION;
  26. $msg = 'Your PHP <strong>%s</strong> is %s than the minimum of <strong>%s</strong> required';
  27. // Check PHP version
  28. if (version_compare($your_php_version, $min_php_version, '<')) {
  29. $this->msg = sprintf($msg, $your_php_version, 'less', $min_php_version);
  30. } else {
  31. $this->msg = sprintf($msg, $your_php_version, 'greater', $min_php_version);
  32. $this->status = true;
  33. }
  34. return $this;
  35. }
  36. }