• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gordalina / cachetool / 11813158491

13 Nov 2024 08:12AM UTC coverage: 90.117%. Remained the same
11813158491

push

github

web-flow
Merge pull request #252 from dritter/fix-typos

Fix some typos

0 of 3 new or added lines in 1 file covered. (0.0%)

848 of 941 relevant lines covered (90.12%)

81.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.56
/src/Command/AbstractOpcacheCommand.php
1
<?php
2

3
/*
4
 * This file is part of CacheTool.
5
 *
6
 * (c) Samuel Gordalina <samuel.gordalina@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
namespace CacheTool\Command;
13

14
abstract class AbstractOpcacheCommand extends AbstractCommand
15
{
16
    /**
17
     * @param array $info
18
     */
19
    protected function ensureSuccessfulOpcacheCall($info)
20
    {
21
        if ($info === false) {
21✔
NEW
22
           throw new \RuntimeException('opcache_get_status(): No Opcache status info available. Perhaps Opcache is disabled via opcache.enable or opcache.enable_cli?');
×
23
        }
24

25
        if ($info['restart_pending'] ?? false) {
21✔
NEW
26
            $cacheStatus = $info['cache_full'] ? 'Also, your cache is full.' : '';
×
NEW
27
            throw new \RuntimeException("OPCache is restarting, as such files can't be invalidated. Try again later. {$cacheStatus}");
×
28
        }
29

30
        $file_cache_only = $info['file_cache_only'] ?? false;
21✔
31
        $opcache_enabled = $info['opcache_enabled'] ?? false;
21✔
32

33
        if (!$opcache_enabled && $file_cache_only) {
21✔
34
            throw new \RuntimeException("Couldn't execute command because opcache is only functioning as a file cache. Set `opcache.file_cache_only` to false if you want to use this command. Read more at https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.file-cache-only");
×
35
        }
36
    }
37
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc