| Total Complexity | 2 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class OpcachePrimer |
||
| 14 | { |
||
| 15 | public function __construct() |
||
| 16 | { |
||
| 17 | if (!\function_exists('opcache_compile_file')) { |
||
| 18 | throw new \Exception('Opcache is not enabled'); |
||
| 19 | } |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Prime/Warm the cache for given paths. |
||
| 24 | * |
||
| 25 | * @param array $paths |
||
| 26 | * |
||
| 27 | * @return int The count of files whose opcache primed/warmed. |
||
| 28 | */ |
||
| 29 | public function prime(array $paths): int |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Filter php files. |
||
| 50 | * |
||
| 51 | * @param \RecursiveIteratorIterator $iterator |
||
| 52 | * |
||
| 53 | * @return \FilterIterator |
||
| 54 | */ |
||
| 55 | protected function filter(\RecursiveIteratorIterator $iterator): \FilterIterator |
||
| 61 | } |
||
| 62 | }; |
||
| 63 | } |
||
| 64 | } |
||
| 65 |