1 | <?php |
||
9 | class ConfigGenerator |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $path; |
||
15 | |||
16 | /** |
||
17 | * @var Filesystem |
||
18 | */ |
||
19 | private $filesystem; |
||
20 | |||
21 | /** |
||
22 | * @var Formatter |
||
23 | */ |
||
24 | private $formatter; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $directory; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | private $elementGenerators = array(); |
||
35 | |||
36 | /** |
||
37 | * @param string $path |
||
38 | */ |
||
39 | public function __construct($path, Filesystem $filesystem, Formatter $formatter, $codePool = 'local') |
||
45 | |||
46 | public function addElementGenerator(ConfigElementInterface $elementGenerator) |
||
50 | |||
51 | /** |
||
52 | * @param string $type |
||
53 | */ |
||
54 | public function generateElement($type, $moduleName) |
||
74 | |||
75 | private function getDirectoryPath($moduleName) |
||
80 | |||
81 | private function getCurrentConfigXml($moduleName) |
||
91 | |||
92 | private function getFilePath() |
||
96 | |||
97 | private function moduleFileExists() |
||
101 | |||
102 | private function getIndentedXml(\SimpleXMLElement $xml) |
||
112 | |||
113 | /** |
||
114 | * @param string $xml |
||
115 | */ |
||
116 | private function writeConfigFile($xml) |
||
123 | } |
||
124 |