|
Server : Apache System : Linux s1230 5.15.0-139-generic #149~20.04.1 SMP Tue Jul 14 11:21:49 UTC 2026 x86_64 User : p141464 ( 418825) PHP Version : 7.4.33.12 Disable Function : NONE Directory : /usr/local/chroot/lib/sailfish/fpm/control/ |
Upload File : |
<?php
/**
* Warmup cached php files in opcache after invalidating caches
*
*/
if (!function_exists('opcache_get_configuration'))
{
die('OPCache is not installed/running');
}
$iniPath = php_ini_loaded_file();
$paccount = explode("/", $iniPath)[4];
$dumpFile = '/home/www/' . $paccount . '/tmp/' . $paccount . '_opcache_dump.data';
if(file_exists($dumpFile))
{
$data = file($dumpFile);
}
else
{
die('dumpfile "' . dumpFile . '" does not exist');
}
if (empty($data))
{
die('no cached files');
}
foreach ($data as $script)
{
$script = trim($script);
if (file_exists ($script))
{
try {
// suppress compile_file warnings when file not found
// possible, because opcache_compile_file is fault tolerant and won't do harm if files aren't found
// (indicates that those files aren't valid anymore anyway)
@opcache_compile_file($script);
} catch(Exception $e) {}
}
}