Browse Source

Added support for redis with HHVM

release/v3.3.0
gau1991 10 years ago
parent
commit
2fbaa00be3
  1. 34
      ee/cli/plugins/site_functions.py
  2. 12
      ee/cli/plugins/stack.py

34
ee/cli/plugins/site_functions.py

@ -614,6 +614,40 @@ def site_package_check(self, stype):
if not EEAptGet.is_installed(self, 'redis-server'):
apt_packages = apt_packages + EEVariables.ee_redis
if os.path.isfile("/etc/nginx/nginx.conf") and (not
os.path.isfile("/etc/nginx/common/redis.conf")):
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/redis.conf')
ee_nginx = open('/etc/nginx/common/redis.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'redis.mustache',
out=ee_nginx)
ee_nginx.close()
if os.path.isfile("/etc/nginx/nginx.conf") and (not
os.path.isfile("/etc/nginx/common/redis-hhvm.conf")):
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/redis-hhvm.conf')
ee_nginx = open('/etc/nginx/common/redis-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'redis-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
if not EEFileUtils.grep(self, "/etc/nginx/conf.d/"
"upstream.conf",
"redis"):
with open("/etc/nginx/conf.d/upstream.conf",
"a") as redis_file:
redis_file.write("upstream redis {\n"
" server 127.0.0.1:6379;\n"
" keepalive 10;\n}")
if self.app.pargs.hhvm:
if platform.architecture()[0] is '32bit':
Log.error(self, "HHVM is not supported by 32bit system")

12
ee/cli/plugins/stack.py

@ -537,6 +537,18 @@ class EEStackController(CementBaseController):
out=ee_nginx)
ee_nginx.close()
if os.path.isfile("/etc/nginx/nginx.conf") and (not
os.path.isfile("/etc/nginx/common/redis-hhvm.conf")):
data = dict()
Log.debug(self, 'Writting the nginx configuration to '
'file /etc/nginx/common/redis-hhvm.conf')
ee_nginx = open('/etc/nginx/common/redis-hhvm.conf',
encoding='utf-8', mode='w')
self.app.render((data), 'redis-hhvm.mustache',
out=ee_nginx)
ee_nginx.close()
if os.path.isfile("/etc/nginx/conf.d/upstream.conf"):
if not EEFileUtils.grep(self, "/etc/nginx/conf.d/"
"upstream.conf",

Loading…
Cancel
Save