File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1307,12 +1307,22 @@ def doupdatesite(self, pargs):
13071307 if oldcachetype != 'wpredis' and data ['wpredis' ]:
13081308 try :
13091309 if installwp_plugin (self , 'redis-cache' , data ):
1310- if EEShellExec .cmd_exec (self , "grep -q \" WP_CACHE_KEY_SALT\" {0}/wp-config.php"
1311- .format (ee_site_webroot )):
1310+ #search for wp-config.php
1311+ if EEFileUtils .isexist (self ,"{0}/wp-config.php" .format (ee_site_webroot )):
1312+ config_path = '{0}/wp-config.php' .format (ee_site_webroot )
1313+ elif EEFileUtils .isexist (self ,"{0}/htdocs/wp-config.php" .format (ee_site_webroot )):
1314+ config_path = '{0}/htdocs/wp-config.php' .format (ee_site_webroot )
1315+ else :
1316+ Log .debug (self , "Updating wp-config.php failed. File could not be located." )
1317+ Log .error (self ,"wp-config.php could not be located !!" )
1318+ raise SiteError
1319+
1320+ if EEShellExec .cmd_exec (self , "grep -q \" WP_CACHE_KEY_SALT\" {0}"
1321+ .format (config_path )):
13121322 pass
13131323 else :
13141324 try :
1315- wpconfig = open ("{0}/wp-config.php " .format (ee_site_webroot ),
1325+ wpconfig = open ("{0}" .format (config_path ),
13161326 encoding = 'utf-8' , mode = 'a' )
13171327 wpconfig .write ("\n \n define( \' WP_CACHE_KEY_SALT\' , \' {0}:\' );"
13181328 .format (ee_domain ))
You can’t perform that action at this time.
0 commit comments