File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,9 @@ def deleteSiteInfo(self, site):
108108
109109
110110def getAllsites (self ):
111-
111+ """
112+ 1. returns all records from ee database
113+ """
112114 try :
113115 q = SiteDB .query .all ()
114116 return q
@@ -123,12 +125,17 @@ def __init__(self, app):
123125 self .app = app
124126
125127 def syncdbinfo (self ):
128+ """
129+ 1. reads database information from wp/ee-config.php
130+ 2. updates records into ee database accordingly.
131+ """
126132 sites = getAllsites (self )
127133 if not sites :
128134 pass
129135 for site in sites :
130136 if site .site_type in ['mysql' , 'wp' , 'wpsubdir' , 'wpsubdomain' ]:
131137 ee_site_webroot = site .site_path
138+ # Read config files
132139 configfiles = glob .glob (ee_site_webroot + '/*-config.php' )
133140 if configfiles :
134141 if EEFileUtils .isexist (self , configfiles [0 ]):
@@ -146,6 +153,7 @@ def syncdbinfo(self):
146153 .split (')' )[0 ].strip ().replace ('\' ' , '' ))
147154
148155 if site .db_name != ee_db_name :
156+ # update records if any mismatch found
149157 Log .debug (self , "Updating {0}"
150158 .format (site .sitename ))
151159 updateSiteInfo (self , site .sitename ,
You can’t perform that action at this time.
0 commit comments