phpmysqladmin保存优化

pull/240/head
midoks 3 years ago
parent 421c9a673c
commit fd23a4c572
  1. 14
      plugins/phpmyadmin/index.py

@ -124,7 +124,8 @@ def contentReplace(content):
content = content.replace('{$BLOWFISH_SECRET}', blowfish_secret)
cfg = getCfg()
if (cfg['choose'] == ""):
if (cfg['choose'] == "mysql"):
content = content.replace('{$CHOOSE_DB}', 'mysql')
content = content.replace('{$CHOOSE_DB_DIR}', 'mysql')
else:
@ -136,7 +137,6 @@ def contentReplace(content):
port = cfg["port"]
rep = 'listen\s*(.*);'
content = re.sub(rep, "listen " + port + ';', content)
return content
@ -327,11 +327,13 @@ def setPmaChoose():
choose = args['choose']
setCfg('choose', choose)
conf_run = getServerDir() + '/phpmyadmin/config.inc.php'
pma_path = getCfg()['path']
conf_run = getServerDir() + "/" + pma_path + '/config.inc.php'
conf_tpl = getPluginDir() + '/conf/config.inc.php'
centent = mw.readFile(conf_tpl)
centent = contentReplace(centent)
mw.writeFile(conf_run, centent)
content = mw.readFile(conf_tpl)
content = contentReplace(content)
mw.writeFile(conf_run, content)
mw.restartWeb()
return mw.returnJson(True, '修改成功!')

Loading…
Cancel
Save