mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
update
This commit is contained in:
@@ -6,7 +6,7 @@ $config = array(
|
||||
array(
|
||||
'name' => 'local server', // Optional name.
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'port' => {$REDIS_PORT},
|
||||
'filter' => '*',
|
||||
'scheme' => 'tcp', // Optional. Connection scheme. 'tcp' - for TCP connection, 'unix' - for connection by unix domain socket
|
||||
'path' => '', // Optional. Path to unix domain socket. Uses only if 'scheme' => 'unix'. Example: '/var/run/redis/redis.sock'
|
||||
|
||||
@@ -122,6 +122,18 @@ def getRedisPass():
|
||||
|
||||
return requirepass
|
||||
|
||||
|
||||
def getRedisPort():
|
||||
port = "6379"
|
||||
conf = mw.getServerDir() + '/redis/redis.conf'
|
||||
if os.path.exists(conf):
|
||||
content = mw.readFile(conf)
|
||||
rep = "^(" + 'port' + ')\s*([.0-9A-Za-z_& ~]+)'
|
||||
tmp = re.search(rep, content, re.M)
|
||||
if tmp:
|
||||
port = tmp.groups()[1]
|
||||
return port
|
||||
|
||||
def contentReplace(content):
|
||||
service_path = mw.getServerDir()
|
||||
php_ver = getCachePhpVer()
|
||||
@@ -138,7 +150,9 @@ def contentReplace(content):
|
||||
|
||||
# REDIS_PASS
|
||||
rd_pass = getRedisPass()
|
||||
rd_port = getRedisPort()
|
||||
content = content.replace('{$REDIS_PASS}', rd_pass)
|
||||
content = content.replace('{$REDIS_PORT}', rd_port)
|
||||
|
||||
cfg = getCfg()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user