laravel opcache
4.0.2
这个包包含一些有用的 Artisan 命令来使用 PHP OPcache。
该软件包需要 Laravel 7 或更高版本。
您可以通过 Composer 安装该软件包:
composer require appstract/laravel-opcache
如果您需要更改配置值,可以使用以下命令发布配置文件:
php artisan vendor:publish --provider= " AppstractOpcacheOpcacheServiceProvider " --tag= " config "
确保 .env 中的 APP_URL 设置正确。
如果您想设置不同的 url 来调用 OPcache 路由(例如与负载均衡器一起使用),您可以设置 OPCACHE_URL。
清除OPcache:
php artisan opcache:clear
显示 OPcache 配置:
php artisan opcache:config
显示 OPcache 状态:
php artisan opcache:status
预编译您的应用程序代码:
php artisan opcache:compile {--force}
注意:必须启用opcache.dups_fix
,或使用--force
标志。如果遇到“无法重新声明类”错误,请启用opcache.dups_fix
或将类路径添加到排除列表中。
编程用法:
use Appstract Opcache OpcacheFacade as OPcache ;
. . .
OPcache:: clear ();
欢迎大家踊跃投稿,谢谢大家:)
Apptract 是一支来自荷兰的小团队。我们为网络开发创建(开源)工具。
麻省理工学院许可证 (MIT)。请参阅许可证文件以获取更多信息。