|
Packit Service |
a2ae7a |
(* PHP module for Augeas *)
|
|
Packit Service |
a2ae7a |
(* Author: Raphael Pinson <raphink@gmail.com> *)
|
|
Packit Service |
a2ae7a |
(* *)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
module PHP =
|
|
Packit Service |
a2ae7a |
autoload xfm
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(************************************************************************
|
|
Packit Service |
a2ae7a |
* INI File settings
|
|
Packit Service |
a2ae7a |
*************************************************************************)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let comment = IniFile.comment IniFile.comment_re IniFile.comment_default
|
|
Packit Service |
a2ae7a |
let sep = IniFile.sep IniFile.sep_re IniFile.sep_default
|
|
Packit Service |
a2ae7a |
let empty = IniFile.empty
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(************************************************************************
|
|
Packit Service |
a2ae7a |
* ENTRY
|
|
Packit Service |
a2ae7a |
*
|
|
Packit Service |
a2ae7a |
* We have to remove the keyword "section" from possible entry keywords
|
|
Packit Service |
a2ae7a |
* otherwise it would lead to an ambiguity with the "section" label
|
|
Packit Service |
a2ae7a |
* since PHP allows entries outside of sections.
|
|
Packit Service |
a2ae7a |
*************************************************************************)
|
|
Packit Service |
a2ae7a |
let entry =
|
|
Packit Service |
a2ae7a |
let word = IniFile.entry_re
|
|
Packit Service |
a2ae7a |
in let entry_re = word . ( "[" . word . "]" )?
|
|
Packit Service |
a2ae7a |
in IniFile.indented_entry entry_re sep comment
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(************************************************************************
|
|
Packit Service |
a2ae7a |
* TITLE
|
|
Packit Service |
a2ae7a |
*
|
|
Packit Service |
a2ae7a |
* We use IniFile.title_label because there can be entries
|
|
Packit Service |
a2ae7a |
* outside of sections whose labels would conflict with section names
|
|
Packit Service |
a2ae7a |
*************************************************************************)
|
|
Packit Service |
a2ae7a |
let title = IniFile.title ( IniFile.record_re - ".anon" )
|
|
Packit Service |
a2ae7a |
let record = IniFile.record title entry
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let record_anon = [ label ".anon" . ( entry | empty )+ ]
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(************************************************************************
|
|
Packit Service |
a2ae7a |
* LENS & FILTER
|
|
Packit Service |
a2ae7a |
* There can be entries before any section
|
|
Packit Service |
a2ae7a |
* IniFile.entry includes comment management, so we just pass entry to lns
|
|
Packit Service |
a2ae7a |
*************************************************************************)
|
|
Packit Service |
a2ae7a |
let lns = record_anon? . record*
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let filter = (incl "/etc/php*/*/*.ini")
|
|
Packit Service |
a2ae7a |
. (incl "/etc/php/*/*/*.ini")
|
|
Packit Service |
a2ae7a |
. (incl "/etc/php.ini")
|
|
Packit Service |
a2ae7a |
. (incl "/etc/php.d/*.ini")
|
|
Packit Service |
a2ae7a |
(* PHPFPM Support *)
|
|
Packit Service |
a2ae7a |
. (incl "/etc/php*/fpm/pool.d/*.conf")
|
|
Packit Service |
a2ae7a |
. (incl "/etc/php/*/fpm/pool.d/*.conf")
|
|
Packit Service |
a2ae7a |
(* Zend Community edition *)
|
|
Packit Service |
a2ae7a |
. (incl "/usr/local/zend/etc/php.ini")
|
|
Packit Service |
a2ae7a |
. (incl "/usr/local/zend/etc/conf.d/*.ini")
|
|
Packit Service |
a2ae7a |
. Util.stdexcl
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let xfm = transform lns filter
|