Add buttons to clear apcu and opcache

This commit is contained in:
Kijin Sung 2021-02-05 20:45:11 +09:00
parent 9160b867aa
commit 80b235001e
6 changed files with 53 additions and 2 deletions

View file

@ -153,6 +153,36 @@ class adminAdminController extends admin
$this->setMessage('success_updated');
}
/**
* Clear APCU cache
*/
public function procAdminClearApcu()
{
if (function_exists('apcu_clear_cache') && apcu_clear_cache())
{
return new BaseObject(0, 'success_updated');
}
else
{
return new BaseObject(-1, 'apcu_clear_cache_function_not_found');
}
}
/**
* Clear opcache
*/
public function procAdminClearOpcache()
{
if (function_exists('opcache_reset') && opcache_reset())
{
return new BaseObject(0, 'success_updated');
}
else
{
return new BaseObject(-1, 'opcache_reset_function_not_found');
}
}
/**
* Logout