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