Skip to content

Commit deb0ef3

Browse files
committed
updated with comments
1 parent 5c86be6 commit deb0ef3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ee/cli/plugins/sitedb.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def deleteSiteInfo(self, site):
108108

109109

110110
def 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,

0 commit comments

Comments
 (0)