import re from wizard import app, deploy, util from wizard.app import php @app.filename_regex_extractor def make_extractor(var): return 'LocalSettings.php', re.compile('^\$' + re.escape(var) + r'''\s*=\s*((["\']).*\2);$''', re.M) class Application(deploy.Application): @property def extractors(self): if not self._extractors: self._extractors = util.dictmap(make_extractor, {'WIZARD_IP': 'IP' # obsolete ,'WIZARD_SITENAME': 'wgSitename' ,'WIZARD_SCRIPTPATH': 'wgScriptPath' ,'WIZARD_EMERGENCYCONTACT': 'wgEmergencyContact' ,'WIZARD_DBSERVER': 'wgDBserver' ,'WIZARD_DBNAME': 'wgDBname' ,'WIZARD_DBUSER': 'wgDBuser' ,'WIZARD_DBPASSWORD': 'wgDBpassword' ,'WIZARD_PROXYKEY': 'wgProxyKey' }) self._extractors.update(php.extractors) return self._extractors