diff --git a/CHANGELOG.md b/CHANGELOG.md
index 70b7b23..70af8b8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,205 +4,138 @@
- The minimum PHP version is now 8.1.
- The minimum PostgreSQL version is now 11.0.
-## 2.1.5 - 2023-05-26
+## 2.1.8 - 2023-09-25
+- Reverted “The `@web` alias check now checks `Craft::$aliases;` instead of `Craft::$app->getConfig()->getGeneral()->aliases;`”.
+
+## 2.1.7 - 2023-09-19
+- Fixed a bug where Opcache extension might not be correct detected on some systems. ([#25](https://github.com/craftcms/server-check/pull/25))
+- Removed the check for php.ini’s `max_execution_time` setting. ([#26](https://github.com/craftcms/server-check/pull/26))
+- The `@web` alias check now checks `Craft::$aliases;` instead of `Craft::$app->getConfig()->getGeneral()->aliases;`.
+
+## 2.1.6 - 2023-09-09
+- Added a requirement for [`opcache.save_comments`](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.save-comments) to be enabled if OPcache is installed. ([craftcms/cms#13631](https://github.com/craftcms/cms/discussions/13631))
+>>>>>>> main
-### Fixed
+## 2.1.5 - 2023-05-26
- Fixed an error that could occur when running the requirements checker using PHP 8+.
## 2.1.4 - 2022-04-16
-
-### Added
- Added checks for relying on the default `@web` alias.
## 2.1.3 - 2022-02-15
-
-### Added
- Added the BCMath extension as a requirement.
## 2.1.2 - 2022-02-14
-
-### Changed
- Bumped the PHP requirement to 8.0.2+.
## 2.1.1 - 2022-02-10
-
-### Fixed
- Fixed a bug where the MariaDB version wasn’t always being parsed correctly. ([craftcms/cms#10456](https://github.com/craftcms/cms/issues/10456))
## 2.1.0 - 2022-02-09
-
-### Changed
- Bumped the PHP requirement to 8.0 for Craft 4.0.
- Bumped the PostgreSQL requirement to 10.0 for Craft 4.0.
- The `intl` extension is now required for Craft 4.0.
## 2.0.1 - 2021-12-07
-
-### Added
- There is now an explicit check for MariaDB, and it requires version 10.2.7 or higher.
## 1.2.1 - 2021-05-25
-
-### Added
- Added a check for MySQL to see if the server has been configured with full timezone support.
## 1.2.0 2020-11-04
-
-### Changed
- Bumped the PHP requirement to 7.2.5 for Craft 3.6.0.
## 1.1.9 - 2020-05-28
-
-### Added
- Added `ignore_user_abort` as an optional method.
## 1.1.8 - 2020-01-17
-
-### Changed
- Changed the image extension check to make sure that if Imagick is installed, it can actually process images.
## 1.1.7 - 2019-01-31
-
-### Added
- Added a new `max_execution_time` check.
-
-### Changed
- External links now have `rel="noopener"`. ([#9](https://github.com/craftcms/server-check/pull/9))
- The `memory_limit` check now adds 1MB to the current value if not set to `-1`. ([#10](https://github.com/craftcms/server-check/pull/10))
## 1.1.6 - 2018-08-17
-
-### Changed
- The `ctype` extension is now required because of Yii 2.x.
## 1.1.5 - 2018-08-14
-
-### Changed
- The `iconv` extension is now required because of Twig 2.0.
## 1.1.4 - 2018-07-25
-
-### Changed
- Added `proc_open`, `proc_close`, `proc_terminate`, and `proc_get_status` methods as optional.
- `allow_url_fopen` is now checked to see if it is enabled for Plugin Store and updating operations.
## 1.1.3 - 2018-07-18
-
-### Changed
- The JSON extension is now required. ([#7](https://github.com/craftcms/server-check/issues/7))
## 1.1.2 - 2018-07-18
-
-### Changed
- The Fileinfo extension is now required, not recommended. ([#6](https://github.com/craftcms/server-check/issues/6))
- Improved the wording of some requirement memos. ([#5](https://github.com/craftcms/server-check/issues/5))
- Removed the “Max Upload File Size” and “Max POST Size” requirement checks, as they weren’t actually checking anything.
## 1.1.1 - 2017-12-15
-
-### Changed
- Links within requirement descriptions now open in a new window. ([craftcms/cms#2205](https://github.com/craftcms/cms/issues/2205))
## 1.1.0 - 2017-11-10
-
-### Changed
- The requirements checker no longer attempts to parse a DB config file, and will only run DB requirement checks if a valid `dsn` is provided.
- Lots of refactoring
## 1.0.17 - 2017-06-29
-
-### Changed
- `RequirementsChecker::checkWebRoot()` no longer checks if the `plugins/` folder is in the web root, as there is no `plugins/` folder.
## 1.0.16 - 2017-06-19
-
-### Changed
- `RequirementsChecker::checkWebRoot()` no longer checks if the `app/` folder is in the web root, as there is no `app/` folder.
## 1.0.15 - 2017-06-13
-
-### Changed
- The DOM extension is now mandatory.
## 1.0.14 - 2017-05-07
-
-### Fixed
- Fixed a bug where the script was considering a blank database password to be invalid. ([#4](https://github.com/craftcms/server-check/issues/4))
## 1.0.13 - 2017-05-01
-
-### Changed
- Removed the PHP version requirement from `composer.json`.
## 1.0.12 - 2017-03-19
-
-### Changed
- Craft 3 Beta 8 compatibility.
## 1.0.11 - 2017-03-07
-
-### Fixed
- Fixed a bug where the PHP memory limit check would fail if `memory_limit` was set to `-1`, which means no limit.
## 1.0.10 - 2017-02-21
-
-### Fixed
- Fixed a bug where the requirements checker would error if the Craft project lived at the root of the file system.
## 1.0.9 - 2017-02-13
-
-### Added
- Added the PHP `password_hash()` function as a mandatory requirement.
- Added the PHP Zip extension as a mandatory requirement.
## 1.0.8 - 2017-02-06
-
-### Changed
- Tweaked keywords in composer.json
-
-### Fixed
- Fixed a bug where the default database port wasn’t being accounted for when connecting to the database.
## 1.0.7 - 2017-01-30
-
-### Changed
- Updated the `support` properties in composer.json
- Craft 3 no longer requires `mcrypt`.
## 1.0.6 - 2017-01-17
-
-### Added
- Added support for configuring the database port
## 1.0.5 - 2017-01-17
-
-### Fixed
- Fixed a bug where `checkIniSet()` wasn’t undoing a change it made to PHP’s `memory_limit` setting.
## 1.0.4 - 2017-01-17
-
-### Changed
- Craft 3 now requires PHP 7
## 1.0.3 - 2017-01-17
-
-### Changed
- Updated code for latest Craft coding guidelines
-
-### Removed
- Removed check for buggy `iconv` extension
## 1.0.2 - 2016-12-30
-
-### Changed
- Autoloading support in composer.json
## 1.0.1 - 2016-12-30
-
-### Changed
- No longer specifying a minimum stability in composer.json
- MIT license in composer.json
## 1.0.0 - 2016-12-30
-
Initial release.
diff --git a/server/requirements/RequirementsChecker.php b/server/requirements/RequirementsChecker.php
index dbfcfc2..62da87b 100644
--- a/server/requirements/RequirementsChecker.php
+++ b/server/requirements/RequirementsChecker.php
@@ -519,26 +519,6 @@ function memoryLimitRequirement()
);
}
- /**
- * @return array
- *
- * @see https://php.net/manual/en/info.configuration.php#ini.max-execution-time
- */
- function maxExecutionTimeRequirement()
- {
- $maxExecutionTime = (int)trim(ini_get('max_execution_time'));
-
- $humanTime = $maxExecutionTime . ($maxExecutionTime === 0 ? ' (no limit)' : '');
- $memo = "Craft requires a minimum PHP max execution time of 120 seconds. The max_execution_time directive in php.ini is currently set to {$humanTime}.";
-
- return array(
- 'name' => 'Max Execution Time',
- 'mandatory' => false,
- 'condition' => $maxExecutionTime === 0 || $maxExecutionTime >= 120,
- 'memo' => $memo,
- );
- }
-
/**
* @return array
*/
diff --git a/server/requirements/requirements.php b/server/requirements/requirements.php
index 38530a6..98fe053 100644
--- a/server/requirements/requirements.php
+++ b/server/requirements/requirements.php
@@ -14,10 +14,12 @@
);
$conn = $this->getDbConnection();
+$pdoExtensionRequirement = null;
+$opCacheLoaded = extension_loaded('opcache') || extension_loaded('Zend OPcache');
switch ($this->dbDriver) {
case 'mysql':
- $requirements[] = array(
+ $pdoExtensionRequirement = array(
'name' => 'PDO MySQL extension',
'mandatory' => true,
'condition' => extension_loaded('pdo_mysql'),
@@ -56,7 +58,7 @@
}
break;
case 'pgsql':
- $requirements[] = array(
+ $pdoExtensionRequirement = array(
'name' => 'PDO PostgreSQL extension',
'mandatory' => true,
'condition' => extension_loaded('pdo_pgsql'),
@@ -79,42 +81,36 @@
$requirements[] = $this->webAliasRequirement();
}
-$requirements = array_merge($requirements, array(
+$requirements = array_merge($requirements, array_filter(array(
array(
- 'name' => 'Reflection extension',
- 'mandatory' => true,
- 'condition' => extension_loaded('reflection'),
- 'memo' => 'The Reflection extension is required.',
- ),
- array(
- 'name' => 'PCRE extension (with UTF-8 support)',
+ 'name' => 'BCMath extension',
'mandatory' => true,
- 'condition' => extension_loaded('pcre') && preg_match('/./u', 'Ü') === 1,
- 'memo' => 'The PCRE extension is required and it must be compiled to support UTF-8.',
+ 'condition' => extension_loaded('bcmath'),
+ 'memo' => 'The BCMath extension is required.'
),
array(
- 'name' => 'SPL extension',
+ 'name' => 'ctype extension',
'mandatory' => true,
- 'condition' => extension_loaded('SPL'),
- 'memo' => 'The SPL extension is required.'
+ 'condition' => extension_loaded('ctype'),
+ 'memo' => 'The ctype extension is required.',
),
array(
- 'name' => 'BCMath extension',
+ 'name' => 'cURL extension',
'mandatory' => true,
- 'condition' => extension_loaded('bcmath'),
- 'memo' => 'The BCMath extension is required.'
+ 'condition' => extension_loaded('curl'),
+ 'memo' => 'The cURL extension is required.',
),
array(
- 'name' => 'PDO extension',
+ 'name' => 'DOM extension',
'mandatory' => true,
- 'condition' => extension_loaded('pdo'),
- 'memo' => 'The PDO extension is required.'
+ 'condition' => extension_loaded('dom'),
+ 'memo' => 'The DOM extension is required.',
),
array(
- 'name' => 'Multibyte String extension (with Function Overloading disabled)',
+ 'name' => 'Fileinfo extension',
'mandatory' => true,
- 'condition' => extension_loaded('mbstring') && ini_get('mbstring.func_overload') == 0,
- 'memo' => 'Craft CMS requires the Multibyte String extension with Function Overloading disabled in order to run.'
+ 'condition' => extension_loaded('fileinfo'),
+ 'memo' => 'The Fileinfo extension required.'
),
array(
'name' => 'GD extension or ImageMagick extension',
@@ -123,55 +119,67 @@
'memo' => 'When using Craft\'s default image transformer, the GD or ImageMagick extension is required. ImageMagick is recommended as it adds animated GIF support, and preserves 8-bit and 24-bit PNGs during image transforms.'
),
array(
- 'name' => 'OpenSSL extension',
+ 'name' => 'iconv extension',
'mandatory' => true,
- 'condition' => extension_loaded('openssl'),
- 'memo' => 'The OpenSSL extension is required.'
+ 'condition' => function_exists('iconv'),
+ 'memo' => 'iconv is required for more robust character set conversion support.',
),
array(
- 'name' => 'cURL extension',
+ 'name' => 'Intl extension',
'mandatory' => true,
- 'condition' => extension_loaded('curl'),
- 'memo' => 'The cURL extension is required.',
+ 'condition' => $this->checkPhpExtensionVersion('intl', '1.0.2', '>='),
+ 'memo' => 'The Intl extension (version 1.0.2+) is recommended.'
),
array(
- 'name' => 'ctype extension',
+ 'name' => 'JSON extension',
'mandatory' => true,
- 'condition' => extension_loaded('ctype'),
- 'memo' => 'The ctype extension is required.',
+ 'condition' => extension_loaded('json'),
+ 'memo' => 'The JSON extension is required for JSON encoding and decoding.',
),
- $this->iniSetRequirement(),
array(
- 'name' => 'Intl extension',
+ 'name' => 'Multibyte String extension (with Function Overloading disabled)',
'mandatory' => true,
- 'condition' => $this->checkPhpExtensionVersion('intl', '1.0.2', '>='),
- 'memo' => 'The Intl extension (version 1.0.2+) is recommended.'
+ 'condition' => extension_loaded('mbstring') && ini_get('mbstring.func_overload') == 0,
+ 'memo' => 'Craft CMS requires the Multibyte String extension with Function Overloading disabled in order to run.'
),
array(
- 'name' => 'Fileinfo extension',
+ 'name' => $opCacheLoaded ? 'OPcache extension (with save_comments)' : 'OPcache extension',
+ 'mandatory' => $opCacheLoaded,
+ 'condition' => $opCacheLoaded && ini_get('opcache.save_comments') == 1,
+ 'memo' => $opCacheLoaded
+ ? 'The opcache.save_comments configuration setting must be enabled.'
+ : 'The OPcache extension is recommended in production environments.'
+ ),
+ array(
+ 'name' => 'OpenSSL extension',
'mandatory' => true,
- 'condition' => extension_loaded('fileinfo'),
- 'memo' => 'The Fileinfo extension required.'
+ 'condition' => extension_loaded('openssl'),
+ 'memo' => 'The OpenSSL extension is required.'
),
array(
- 'name' => 'DOM extension',
+ 'name' => 'PCRE extension (with UTF-8 support)',
'mandatory' => true,
- 'condition' => extension_loaded('dom'),
- 'memo' => 'The DOM extension is required.',
+ 'condition' => extension_loaded('pcre') && preg_match('/./u', 'Ü') === 1,
+ 'memo' => 'The PCRE extension is required and it must be compiled to support UTF-8.',
),
array(
- 'name' => 'iconv extension',
+ 'name' => 'PDO extension',
'mandatory' => true,
- 'condition' => function_exists('iconv'),
- 'memo' => 'iconv is required for more robust character set conversion support.',
+ 'condition' => extension_loaded('pdo'),
+ 'memo' => 'The PDO extension is required.'
),
- $this->memoryLimitRequirement(),
- $this->maxExecutionTimeRequirement(),
+ $pdoExtensionRequirement,
array(
- 'name' => 'password_hash()',
+ 'name' => 'Reflection extension',
'mandatory' => true,
- 'condition' => function_exists('password_hash'),
- 'memo' => 'The password_hash() function is required so Craft can create secure passwords.',
+ 'condition' => extension_loaded('reflection'),
+ 'memo' => 'The Reflection extension is required.',
+ ),
+ array(
+ 'name' => 'SPL extension',
+ 'mandatory' => true,
+ 'condition' => extension_loaded('SPL'),
+ 'memo' => 'The SPL extension is required.'
),
array(
'name' => 'Zip extension',
@@ -179,17 +187,24 @@
'condition' => extension_loaded('zip'),
'memo' => 'The zip extension is required for zip and unzip operations.',
),
+
array(
- 'name' => 'JSON extension',
+ 'name' => 'ignore_user_abort()',
+ 'mandatory' => false,
+ 'condition' => function_exists('ignore_user_abort'),
+ 'memo' => 'ignore_user_abort() must be enabled in your PHP configuration for the native web-based queue runner to work.',
+ ),
+ array(
+ 'name' => 'password_hash()',
'mandatory' => true,
- 'condition' => extension_loaded('json'),
- 'memo' => 'The JSON extension is required for JSON encoding and decoding.',
+ 'condition' => function_exists('password_hash'),
+ 'memo' => 'The password_hash() function is required so Craft can create secure passwords.',
),
array(
- 'name' => 'proc_open()',
+ 'name' => 'proc_close()',
'mandatory' => false,
- 'condition' => function_exists('proc_open'),
- 'memo' => 'The proc_open() function is required for Plugin Store operations as well as sending emails.',
+ 'condition' => function_exists('proc_close'),
+ 'memo' => 'The proc_close() function is required for Plugin Store operations as well as sending emails.',
),
array(
'name' => 'proc_get_status()',
@@ -198,10 +213,10 @@
'memo' => 'The proc_get_status() function is required for Plugin Store operations as well as sending emails.',
),
array(
- 'name' => 'proc_close()',
+ 'name' => 'proc_open()',
'mandatory' => false,
- 'condition' => function_exists('proc_close'),
- 'memo' => 'The proc_close() function is required for Plugin Store operations as well as sending emails.',
+ 'condition' => function_exists('proc_open'),
+ 'memo' => 'The proc_open() function is required for Plugin Store operations as well as sending emails.',
),
array(
'name' => 'proc_terminate()',
@@ -209,18 +224,16 @@
'condition' => function_exists('proc_terminate'),
'memo' => 'The proc_terminate() function is required for Plugin Store operations as well as sending emails.',
),
+
array(
'name' => 'allow_url_fopen',
'mandatory' => false,
'condition' => ini_get('allow_url_fopen'),
'memo' => 'allow_url_fopen must be enabled in your PHP configuration for Plugin Store and updating operations.',
),
- array(
- 'name' => 'ignore_user_abort()',
- 'mandatory' => false,
- 'condition' => function_exists('ignore_user_abort'),
- 'memo' => 'ignore_user_abort() must be enabled in your PHP configuration for the native web-based queue runner to work.',
- ),
-));
+
+ $this->iniSetRequirement(),
+ $this->memoryLimitRequirement(),
+)));
return $requirements;