izisoft / yii2-opcache
Yii2 OpCache 模块 - 显示统计信息、配置、重置全部、失效文件、搜索缓存文件
1.04
2017-05-19 11:19 UTC
Requires
- php: >=5.6.0
- yiisoft/yii2: *
- yiisoft/yii2-bootstrap: ^2.0
README
显示统计信息、配置、重置全部、失效文件、搜索缓存文件
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一:
php composer.phar require --prefer-dist insolita/yii2-opcache "~1.0"
或者将以下内容添加到您的 composer.json
文件的 require 部分:
"insolita/yii2-opcache": "~1.0"
to the require section of your composer.json
file.
使用方法
扩展安装完成后,只需在代码中通过以下方式使用它:
'bootstrap'=>[ ... \insolita\opcache\Bootstrap::class ... ], ... 'modules'=>[ ... 'opcache'=>[ 'class'=>'insolita\opcache\OpcacheModule', 'as access'=>[ 'class' => \yii\filters\AccessControl::class, 'rules' => [ [ 'allow' => true, //Protect access 'roles' => ['developer'], ], ], ] ], ... ]
访问路由 ['/opcache/default/index']
对于控制台命令的使用 - 在控制台配置中添加
'bootstrap'=>[ ... \insolita\opcache\Bootstrap::class ... ], ... 'controllerMap'=>[ 'opcache'=>[ 'class'=>\insolita\opcache\commands\OpcacheController::class ] ]
commands opcache/status opcache/config opcache/files opcache/reset opcache/invalidate 将可用
屏幕截图
理解 OpCache
@see https://habrahabr.ru/company/mailru/blog/310054/ (Ru)
@see http://jpauli.github.io/2015/03/05/opcache.html (En)
P.S.
俄语设置翻译基于 https://sabini.ch/cms/perevod-nastroek-zend-opcache.html