From 07887b226f8234f07f7f76e2b4b5f63205f47feb Mon Sep 17 00:00:00 2001 From: Italo Date: Mon, 8 Jun 2020 15:55:00 -0400 Subject: [PATCH 1/3] Added missing section in TOC. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 70001be..b8ba060 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ This package generates a [PHP 7.4 preloading](https://www.php.net/manual/en/opca - [Configuration](#configuration) * [Conditions](#conditions) + [`when()`](#when) + + [`whenOneIn()`](#whenOneIn) * [Listing](#listing) + [`append()`](#append) + [`exclude()`](#exclude) From fabb6a3c52a788731cf977bd222e568b0d6e3e6e Mon Sep 17 00:00:00 2001 From: Italo Date: Mon, 8 Jun 2020 15:55:24 -0400 Subject: [PATCH 2/3] Added missing section in TOC. From 0ac149ee113aecb87f67d7dbff7b1f4333e93ca3 Mon Sep 17 00:00:00 2001 From: DarkGhostHunter Date: Sat, 4 Jul 2020 23:44:06 -0400 Subject: [PATCH 3/3] Clearer exception when Opcache is disabled. (from #39) --- src/Opcache.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Opcache.php b/src/Opcache.php index 43ac74a..9cd30b9 100644 --- a/src/Opcache.php +++ b/src/Opcache.php @@ -2,31 +2,38 @@ namespace DarkGhostHunter\Preloader; +use RuntimeException; + /** * Class Opcache * * This is just a class to enable mocking for testing - * - * @package DarkGhostHunter\Preloader */ class Opcache { /** - * Her we will save the Opcache status instead of retrieving it every time from Opcache + * Here we will save the Opcache status instead of retrieving it every time. * - * @var array + * @var array|false */ - protected array $status; + protected $status; /** * Get status information about the cache * * @see https://www.php.net/manual/en/function.opcache-get-status.php * @return array + * @throws \RuntimeException When Opcache is disabled. */ public function getStatus() : array { - return $this->status ??= opcache_get_status(true); + if ($this->status ??= opcache_get_status(true)) { + return $this->status; + } + + throw new RuntimeException( + 'Opcache is disabled. Further reference: https://www.php.net/manual/en/opcache.configuration' + ); } /**