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)。請參閱許可證文件以獲取更多資訊。