apache
wp-content
mu-plugins
plugins
activitypub
audioigniter
authldap
companion-auto-update
easy-digital-downloads
gitium
gp-premium
jetpack-protect
menu-icons
simple-local-avatars
smtp-mailer
two-factor
wp-piwik
wp-webauthn
blocks
css
js
languages
vendor
beberlei
brick
composer
fgrosse
league
nyholm
php-http
psr
ramsey
spomky-labs
symfony
thecodingmachine
safe
deprecated
generated
Exceptions
apache.php
apcu.php
array.php
bzip2.php
calendar.php
classobj.php
com.php
cubrid.php
curl.php
datetime.php
dir.php
eio.php
errorfunc.php
exec.php
fileinfo.php
filesystem.php
filter.php
fpm.php
ftp.php
funchand.php
functionsList.php
gmp.php
gnupg.php
hash.php
ibase.php
ibmDb2.php
iconv.php
image.php
imap.php
info.php
ingres-ii.php
inotify.php
json.php
ldap.php
libxml.php
lzf.php
mailparse.php
mbstring.php
misc.php
msql.php
mysql.php
mysqli.php
mysqlndMs.php
mysqlndQc.php
network.php
oci8.php
opcache.php
openssl.php
outcontrol.php
password.php
pcntl.php
pcre.php
pdf.php
pgsql.php
posix.php
ps.php
pspell.php
readline.php
rpminfo.php
rrd.php
sem.php
session.php
shmop.php
simplexml.php
sockets.php
sodium.php
solr.php
spl.php
sqlsrv.php
ssdeep.php
ssh2.php
stream.php
strings.php
swoole.php
uodbc.php
uopz.php
url.php
var.php
xdiff.php
xml.php
xmlrpc.php
yaml.php
yaz.php
zip.php
zlib.php
lib
LICENSE
README.md
composer.json
rector-migrate-0.7.php
web-auth
web-token
autoload.php
LICENSE
readme.txt
wp-webauthn.php
wwa-admin-content.php
wwa-ajax.php
wwa-compatibility.php
wwa-functions.php
wwa-menus.php
wwa-profile-content.php
wwa-shortcodes.php
wwa-version.php
index.php
themes
index.php
.dbsetup
.gitignore
htaccess
php.ini
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Safe;
|
|
|
|
use Safe\Exceptions\OpcacheException;
|
|
|
|
/**
|
|
* This function compiles a PHP script and adds it to the opcode cache without
|
|
* executing it. This can be used to prime the cache after a Web server
|
|
* restart by pre-caching files that will be included in later requests.
|
|
*
|
|
* @param string $file The path to the PHP script to be compiled.
|
|
* @throws OpcacheException
|
|
*
|
|
*/
|
|
function opcache_compile_file(string $file): void
|
|
{
|
|
error_clear_last();
|
|
$result = \opcache_compile_file($file);
|
|
if ($result === false) {
|
|
throw OpcacheException::createFromPhpError();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
* This function returns state information about the cache instance
|
|
*
|
|
* @param bool $get_scripts Include script specific state information
|
|
* @return array Returns an array of information, optionally containing script specific state information.
|
|
* @throws OpcacheException
|
|
*
|
|
*/
|
|
function opcache_get_status(bool $get_scripts = true): array
|
|
{
|
|
error_clear_last();
|
|
$result = \opcache_get_status($get_scripts);
|
|
if ($result === false) {
|
|
throw OpcacheException::createFromPhpError();
|
|
}
|
|
return $result;
|
|
}
|