diff --git a/plugins/php/index.py b/plugins/php/index.py index 020aa8d64..2f082d0c7 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -1014,6 +1014,10 @@ def getConfAppStart(): pstart = mw.getServerDir() + '/php/app_start.php' return pstart +def opcacheBlacklistFile(): + op_bl = mw.getServerDir() + '/php/opcache-blacklist.txt' + return op_bl + def installPreInspection(version): # 仅对PHP52检查 @@ -1085,6 +1089,8 @@ if __name__ == "__main__": print(getConf(version)) elif func == 'app_start': print(getConfAppStart()) + elif func == 'opcache_blacklist_file': + print(opcacheBlacklistFile()) elif func == 'get_php_conf': print(getPhpConf(version)) elif func == 'get_fpm_conf_file': diff --git a/plugins/php/js/php.js b/plugins/php/js/php.js index 2d027bb3d..777c5b995 100755 --- a/plugins/php/js/php.js +++ b/plugins/php/js/php.js @@ -142,6 +142,7 @@ function phpCommonFunc(version){ con += '

\ \ \ + \ \

'; @@ -181,6 +182,12 @@ function phpPreload(version){ }); } +function phpOpcacheBlacklist(version){ + phpPost('opcache_blacklist_file',version,{},function(data){ + onlineEditFile(0, data['data']); + }); +} + function phpFpmRoot(version){ phpPost('get_fpm_file',version,{},function(data){ diff --git a/plugins/php/versions/common/opcache.sh b/plugins/php/versions/common/opcache.sh index 040ec42f4..678739614 100755 --- a/plugins/php/versions/common/opcache.sh +++ b/plugins/php/versions/common/opcache.sh @@ -38,9 +38,11 @@ Install_lib() echo "php-$version 已安装${LIBNAME},请选择其它版本!" return fi - + + # OPcache 黑名单文件位置。 + # 黑名单文件为文本文件,包含了不进行预编译优化的文件名,每行一个文件名。 + # 黑名单中的文件名可以使用通配符,也可以使用前缀。 此文件中以分号(;)开头的行将被视为注释。 OP_BL=${serverPath}/php/opcache-blacklist.txt - # OPCACHE白名单 if [ ! -f $OP_BL ];then touch $OP_BL fi