1 (* PHP module for Augeas *)
2 (* Author: Raphael Pinson <raphink@gmail.com> *)
8 (************************************************************************
10 *************************************************************************)
12 let comment = IniFile.comment IniFile.comment_re IniFile.comment_default
13 let sep = IniFile.sep IniFile.sep_re IniFile.sep_default
14 let empty = IniFile.empty
17 (************************************************************************
20 * We have to remove the keyword "section" from possible entry keywords
21 * otherwise it would lead to an ambiguity with the "section" label
22 * since PHP allows entries outside of sections.
23 *************************************************************************)
25 let word = IniFile.entry_re
26 in let entry_re = word . ( "[" . word . "]" )?
27 in IniFile.indented_entry entry_re sep comment
30 (************************************************************************
33 * We use IniFile.title_label because there can be entries
34 * outside of sections whose labels would conflict with section names
35 *************************************************************************)
36 let title = IniFile.title ( IniFile.record_re - ".anon" )
37 let record = IniFile.record title entry
39 let record_anon = [ label ".anon" . ( entry | empty )+ ]
42 (************************************************************************
44 * There can be entries before any section
45 * IniFile.entry includes comment management, so we just pass entry to lns
46 *************************************************************************)
47 let lns = record_anon? . record*
49 let filter = (incl "/etc/php*/*/*.ini")
50 . (incl "/etc/php/*/*/*.ini")
51 . (incl "/etc/php.ini")
52 . (incl "/etc/php.d/*.ini")
54 . (incl "/etc/php*/fpm/pool.d/*.conf")
55 . (incl "/etc/php/*/fpm/pool.d/*.conf")
56 (* Zend Community edition *)
57 . (incl "/usr/local/zend/etc/php.ini")
58 . (incl "/usr/local/zend/etc/conf.d/*.ini")
61 let xfm = transform lns filter