Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
PreloaderCacheInfo.php
Go to the documentation of this file.
1<?php
2
4
16 private const PRELOAD_KEY_CACHE = 'preload_statistics';
17
18 private static function getStatus() {
19 return \opcache_get_status ();
20 }
21
22 private static function getElement($part, $default): ?array {
23 return self::getStatus () [self::PRELOAD_KEY_CACHE] [$part] ?? $default;
24 }
25
31 public static function isActive(): bool {
32 return \is_array ( self::getStatistics () );
33 }
34
40 public static function getStatistics(): ?array {
41 return self::getStatus () [self::PRELOAD_KEY_CACHE] ?? null;
42 }
43
49 public static function getMemoryConsumption(): ?array {
50 return self::getElement ( self::PRELOAD_KEY_CACHE, 0 );
51 }
52
58 public static function getFunctions(): ?array {
59 return self::getElement ( 'functions', [ ] );
60 }
61
67 public static function getScripts(): ?array {
68 return self::getElement ( 'scripts', [ ] );
69 }
70
76 public static function getClasses(): ?array {
77 return self::getElement ( 'classes', [ ] );
78 }
79}
80
Gives some informations about opcache preloading.
static getScripts()
Returns the list of preloaded scripts.
static getClasses()
Returns the list of preloaded classes.
static getFunctions()
Returns the list of preloaded functions.
static getStatistics()
Returrns the opcache preload statistics.
static getMemoryConsumption()
Returns the preloader memory consumption.
static isActive()
Returns true if opcache preloader is activated.