2 Common data and functions for use in PHP applications.
6 from wizard.app.php import *
11 from wizard import app, util
15 Generates a regexp for assignment to ``var`` in PHP; the quoted
16 value is the second subpattern.
18 >>> re_var('key').search("$key = 'val';").group(2)
21 return re.compile('^(\$' + app.expand_re(var) + r'''\s*=\s*)(.*)(;)''', re.M)
25 Generates a regexp for the definition of a constant in PHP; the
26 quoted value is the second subpattern.
28 >>> re_define('FOO').search("define('FOO', 'bar');").group(2)
31 return re.compile('^(define\([\'"]' + app.expand_re(var) + r'''['"]\s*,\s*)(.*)(\);)''', re.M)
33 def _make_filename_regex(var):
34 return 'php.ini', re.compile('^(' + app.expand_re(var) + r'\s*=\s*)(.*)()$', re.M)
36 seed = util.dictmap(_make_filename_regex, {
37 'WIZARD_SESSIONNAME': 'session.name',
38 'WIZARD_TMPDIR': ('upload_tmp_dir', 'session.save_path'),
41 #: Common extractors for parameters in :file:`php.ini`.
42 extractors = app.make_extractors(seed)
43 #: Common substitutions for parameters in :file:`php.ini`.
44 substitutions = app.make_substitutions(seed)
45 #: A list containing :file:`php.ini`.
46 parametrized_files = ["php.ini"]
47 #: Nop for consistency.
48 deprecated_keys = set([])