Update index_php.py

pull/494/head
midoks 2 years ago
parent 3a8c93b595
commit d4af727e5a
  1. 55
      plugins/php/index_php.py

@ -157,15 +157,6 @@ def makeOpenrestyConf():
w_content = contentReplace(tpl_content, x) w_content = contentReplace(tpl_content, x)
mw.writeFile(dfile, w_content) mw.writeFile(dfile, w_content)
# php-fpm status
# for version in phpversions:
# dfile = sdir + '/web_conf/php/status/phpfpm_status_' + version + '.conf'
# tpl = getPluginDir() + '/conf/phpfpm_status.conf'
# if not os.path.exists(dfile):
# content = mw.readFile(tpl)
# content = contentReplace(content, version)
# mw.writeFile(dfile, content)
def phpPrependFile(version): def phpPrependFile(version):
app_start = getServerDir() + '/app_start.php' app_start = getServerDir() + '/app_start.php'
@ -295,31 +286,27 @@ def phpOp(version, method):
return data[1] return data[1]
def start(version): def getFpmAddress(version):
mw.execShell( fpm_address = '/tmp/php-cgi-{}.sock'.format(version)
'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/www/server/lib/icu/lib') php_fpm_file = getFpmConfFile(version)
return phpOp(version, 'start') try:
content = readFile(php_fpm_file)
tmp = re.findall(r"listen\s*=\s*(.+)", content)
def stop(version): if not tmp:
status = phpOp(version, 'stop') return fpm_address
if tmp[0].find('sock') != -1:
if version == '52': return fpm_address
file = initReplace(version) if tmp[0].find(':') != -1:
data = mw.execShell(file + ' ' + 'stop') listen_tmp = tmp[0].split(':')
if data[1] == '': if bind:
return 'ok' fpm_address = (listen_tmp[0], int(listen_tmp[1]))
return status else:
fpm_address = ('127.0.0.1', int(listen_tmp[1]))
else:
def restart(version): fpm_address = ('127.0.0.1', int(tmp[0]))
return phpOp(version, 'restart') return fpm_address
except:
return fpm_address
def reload(version):
if version == '52':
return phpOp(version, 'restart')
return phpOp(version, 'reload')
def getPhpinfo(version): def getPhpinfo(version):

Loading…
Cancel
Save