3 from wizard import app, deploy, util
4 from wizard.app import php
6 def make_filename_regex(var):
7 return 'LocalSettings.php', re.compile('^(\$' + re.escape(var) + r'''\s*=\s*)(.*)(;)$''', re.M)
9 make_extractor = app.filename_regex_extractor(make_filename_regex)
11 class Application(deploy.Application):
12 parametrized_files = ['LocalSettings.php', 'php.ini']
15 if not self._extractors:
16 self._extractors = util.dictmap(make_extractor,
17 {'WIZARD_IP': 'IP' # obsolete, remove after we're done
18 ,'WIZARD_SITENAME': 'wgSitename'
19 ,'WIZARD_SCRIPTPATH': 'wgScriptPath'
20 ,'WIZARD_EMERGENCYCONTACT': 'wgEmergencyContact'
21 ,'WIZARD_DBSERVER': 'wgDBserver'
22 ,'WIZARD_DBNAME': 'wgDBname'
23 ,'WIZARD_DBUSER': 'wgDBuser'
24 ,'WIZARD_DBPASSWORD': 'wgDBpassword'
25 ,'WIZARD_PROXYKEY': 'wgProxyKey'
27 self._extractors.update(php.extractors)
28 return self._extractors