Browse Source

Changed --redis to --wpredis

release/v3.3.0
gau1991 10 years ago
parent
commit
082bc95faf
  1. 38
      ee/cli/plugins/site.py
  2. 6
      ee/cli/plugins/site_functions.py

38
ee/cli/plugins/site.py

@ -347,7 +347,7 @@ class EESiteCreateController(CementBaseController):
(['--wpsc'], (['--wpsc'],
dict(help="create wordpress single/multi site with wpsc cache", dict(help="create wordpress single/multi site with wpsc cache",
action='store_true')), action='store_true')),
(['--redis'], (['--wpredis'],
dict(help="create wordpress single/multi site with redis cache", dict(help="create wordpress single/multi site with redis cache",
action='store_true')), action='store_true')),
(['--hhvm'], (['--hhvm'],
@ -444,7 +444,7 @@ class EESiteCreateController(CementBaseController):
data = dict(site_name=ee_domain, www_domain=ee_www_domain, data = dict(site_name=ee_domain, www_domain=ee_www_domain,
static=False, basic=True, wp=False, w3tc=False, static=False, basic=True, wp=False, w3tc=False,
wpfc=False, wpsc=False, redis=False, multisite=False, wpfc=False, wpsc=False, wpredis=False, multisite=False,
wpsubdir=False, webroot=ee_site_webroot, wpsubdir=False, webroot=ee_site_webroot,
ee_db_name='', ee_db_user='', ee_db_pass='', ee_db_name='', ee_db_user='', ee_db_pass='',
ee_db_host='') ee_db_host='')
@ -515,7 +515,7 @@ class EESiteCreateController(CementBaseController):
data['pagespeed'] = False data['pagespeed'] = False
pagespeed = 0 pagespeed = 0
if (cache == 'redis' and (not self.app.pargs.experimental)): if (cache == 'wpredis' and (not self.app.pargs.experimental)):
Log.info(self, "Redis is experimental feature and it may not" Log.info(self, "Redis is experimental feature and it may not"
"work with all CSS/JS/Cache of your site.\nYou can " "work with all CSS/JS/Cache of your site.\nYou can "
"disable it by changing cache later.\nDo you wish" "disable it by changing cache later.\nDo you wish"
@ -526,9 +526,9 @@ class EESiteCreateController(CementBaseController):
if check_prompt != "Y" and check_prompt != "y": if check_prompt != "Y" and check_prompt != "y":
Log.info(self, "Not using Redis for site.") Log.info(self, "Not using Redis for site.")
cache = 'basic' cache = 'basic'
data['redis'] = False data['wpredis'] = False
data['basic'] = True data['basic'] = True
self.app.pargs.redis = False self.app.pargs.wpredis = False
# self.app.args.print_help() # self.app.args.print_help()
# if not data: # if not data:
@ -751,7 +751,7 @@ class EESiteUpdateController(CementBaseController):
dict(help="update to wpfc cache", action='store_true')), dict(help="update to wpfc cache", action='store_true')),
(['--wpsc'], (['--wpsc'],
dict(help="update to wpsc cache", action='store_true')), dict(help="update to wpsc cache", action='store_true')),
(['--redis'], (['--wpredis'],
dict(help="update to redis cache", action='store_true')), dict(help="update to redis cache", action='store_true')),
(['--hhvm'], (['--hhvm'],
dict(help='Use HHVM for site', dict(help='Use HHVM for site',
@ -780,7 +780,7 @@ class EESiteUpdateController(CementBaseController):
if not (pargs.php or if not (pargs.php or
pargs.mysql or pargs.wp or pargs.wpsubdir or pargs.mysql or pargs.wp or pargs.wpsubdir or
pargs.wpsubdomain or pargs.w3tc or pargs.wpfc or pargs.wpsubdomain or pargs.w3tc or pargs.wpfc or
pargs.wpsc or pargs.hhvm or pargs.pagespeed or pargs.redis): pargs.wpsc or pargs.hhvm or pargs.pagespeed or pargs.wpredis):
Log.error(self, "Please provide options to update sites.") Log.error(self, "Please provide options to update sites.")
if pargs.all: if pargs.all:
@ -900,7 +900,7 @@ class EESiteUpdateController(CementBaseController):
if stype == 'php': if stype == 'php':
data = dict(site_name=ee_domain, www_domain=ee_www_domain, data = dict(site_name=ee_domain, www_domain=ee_www_domain,
static=False, basic=True, wp=False, w3tc=False, static=False, basic=True, wp=False, w3tc=False,
wpfc=False, wpsc=False, redis=False, multisite=False, wpfc=False, wpsc=False, wpredis=False, multisite=False,
wpsubdir=False, webroot=ee_site_webroot, wpsubdir=False, webroot=ee_site_webroot,
currsitetype=oldsitetype, currcachetype=oldcachetype) currsitetype=oldsitetype, currcachetype=oldcachetype)
@ -908,7 +908,7 @@ class EESiteUpdateController(CementBaseController):
data = dict(site_name=ee_domain, www_domain=ee_www_domain, data = dict(site_name=ee_domain, www_domain=ee_www_domain,
static=False, basic=True, wp=False, w3tc=False, static=False, basic=True, wp=False, w3tc=False,
wpfc=False, wpsc=False, redis=False, multisite=False, wpfc=False, wpsc=False, wpredis=False, multisite=False,
wpsubdir=False, webroot=ee_site_webroot, wpsubdir=False, webroot=ee_site_webroot,
ee_db_name='', ee_db_user='', ee_db_pass='', ee_db_name='', ee_db_user='', ee_db_pass='',
ee_db_host='', ee_db_host='',
@ -963,31 +963,31 @@ class EESiteUpdateController(CementBaseController):
data['w3tc'] = False data['w3tc'] = False
data['wpfc'] = False data['wpfc'] = False
data['wpsc'] = False data['wpsc'] = False
data['redis'] = False data['wpredis'] = False
elif oldcachetype == 'w3tc': elif oldcachetype == 'w3tc':
data['basic'] = False data['basic'] = False
data['w3tc'] = True data['w3tc'] = True
data['wpfc'] = False data['wpfc'] = False
data['wpsc'] = False data['wpsc'] = False
data['redis'] = False data['wpredis'] = False
elif oldcachetype == 'wpfc': elif oldcachetype == 'wpfc':
data['basic'] = False data['basic'] = False
data['w3tc'] = False data['w3tc'] = False
data['wpfc'] = True data['wpfc'] = True
data['wpsc'] = False data['wpsc'] = False
data['redis'] = False data['wpredis'] = False
elif oldcachetype == 'wpsc': elif oldcachetype == 'wpsc':
data['basic'] = False data['basic'] = False
data['w3tc'] = False data['w3tc'] = False
data['wpfc'] = False data['wpfc'] = False
data['wpsc'] = True data['wpsc'] = True
data['redis'] = False data['wpredis'] = False
elif oldcachetype == 'redis': elif oldcachetype == 'wpredis':
data['basic'] = False data['basic'] = False
data['w3tc'] = False data['w3tc'] = False
data['wpfc'] = False data['wpfc'] = False
data['wpsc'] = False data['wpsc'] = False
data['redis'] = True data['wpredis'] = True
if pargs.hhvm != 'off': if pargs.hhvm != 'off':
data['hhvm'] = True data['hhvm'] = True
@ -1081,7 +1081,7 @@ class EESiteUpdateController(CementBaseController):
data['pagespeed'] = True data['pagespeed'] = True
pagespeed = True pagespeed = True
if data['currcachetype'] != 'redis' and pargs.redis: if data['currcachetype'] != 'wpredis' and pargs.wpredis:
if (not pargs.experimental): if (not pargs.experimental):
Log.info(self, "Redis is experimental feature and it may not" Log.info(self, "Redis is experimental feature and it may not"
" work with all plugins of your site.\nYou can " " work with all plugins of your site.\nYou can "
@ -1092,7 +1092,7 @@ class EESiteUpdateController(CementBaseController):
check_prompt = input("Type \"y\" to continue [n]:") check_prompt = input("Type \"y\" to continue [n]:")
if check_prompt != "Y" and check_prompt != "y": if check_prompt != "Y" and check_prompt != "y":
Log.info(self, "Not using Redis for site") Log.info(self, "Not using Redis for site")
data['redis'] = False data['wpredis'] = False
data['basic'] = True data['basic'] = True
cache = 'basic' cache = 'basic'
@ -1234,7 +1234,7 @@ class EESiteUpdateController(CementBaseController):
" `tail /var/log/ee/ee.log` & Try Again!!!") " `tail /var/log/ee/ee.log` & Try Again!!!")
return 1 return 1
if oldcachetype == 'redis' and not data['redis']: if oldcachetype == 'wpredis' and not data['wpredis']:
try: try:
uninstallwp_plugin(self, 'redis-cache', data) uninstallwp_plugin(self, 'redis-cache', data)
except SiteError as e: except SiteError as e:
@ -1265,7 +1265,7 @@ class EESiteUpdateController(CementBaseController):
"`tail /var/log/ee/ee.log` & Try Again!!!") "`tail /var/log/ee/ee.log` & Try Again!!!")
return 1 return 1
if oldcachetype != 'redis' and data['redis']: if oldcachetype != 'wpredis' and data['wpredis']:
try: try:
installwp_plugin(self, 'redis-cache', data) installwp_plugin(self, 'redis-cache', data)
except SiteError as e: except SiteError as e:

6
ee/cli/plugins/site_functions.py

@ -450,7 +450,7 @@ def setupwordpress(self, data):
installwp_plugin(self, 'wp-super-cache', data) installwp_plugin(self, 'wp-super-cache', data)
"""Install Redis Cache""" """Install Redis Cache"""
if data['redis']: if data['wpredis']:
installwp_plugin(self, 'redis-cache', data) installwp_plugin(self, 'redis-cache', data)
"""Install W3 Total Cache""" """Install W3 Total Cache"""
@ -622,7 +622,7 @@ def site_package_check(self, stype):
"wp-cli-{0}.phar" "wp-cli-{0}.phar"
.format(EEVariables.ee_wp_cli), .format(EEVariables.ee_wp_cli),
"/usr/bin/wp", "WP-CLI"]] "/usr/bin/wp", "WP-CLI"]]
if self.app.pargs.redis: if self.app.pargs.wpredis:
Log.debug(self, "Setting apt_packages variable for redis") Log.debug(self, "Setting apt_packages variable for redis")
if not EEAptGet.is_installed(self, 'redis-server'): if not EEAptGet.is_installed(self, 'redis-server'):
apt_packages = apt_packages + EEVariables.ee_redis apt_packages = apt_packages + EEVariables.ee_redis
@ -873,7 +873,7 @@ def detSitePar(opts):
if val and key in ['html', 'php', 'mysql', 'wp', if val and key in ['html', 'php', 'mysql', 'wp',
'wpsubdir', 'wpsubdomain']: 'wpsubdir', 'wpsubdomain']:
typelist.append(key) typelist.append(key)
elif val and key in ['wpfc', 'wpsc', 'w3tc', 'redis']: elif val and key in ['wpfc', 'wpsc', 'w3tc', 'wpredis']:
cachelist.append(key) cachelist.append(key)
if len(typelist) > 1 or len(cachelist) > 1: if len(typelist) > 1 or len(cachelist) > 1:

Loading…
Cancel
Save