1 | <?php |
||
15 | class RootDiscovery |
||
16 | { |
||
17 | protected $baseDirectory; |
||
18 | protected $rootDirectory; |
||
19 | protected $configReaderFactory; |
||
20 | |||
21 | /** |
||
22 | 5 | * @param string $baseDirectory The directory from which to start the search |
|
23 | * @param ConfigReaderFactory $configReaderFactory |
||
24 | 5 | */ |
|
25 | 5 | public function __construct($baseDirectory, ConfigReaderFactory $configReaderFactory = null) |
|
34 | 5 | ||
35 | 5 | /** |
|
36 | * The root directory of the first Magento installation found in the base directory. |
||
37 | * |
||
38 | 5 | * @return null|string |
|
39 | */ |
||
40 | public function getRootDirectory() |
||
48 | |||
49 | /** |
||
50 | 4 | * @return ConfigReader |
|
51 | 1 | */ |
|
52 | public function getConfigReader() |
||
59 | |||
60 | /** |
||
61 | * @return string |
||
62 | */ |
||
63 | public function getInstallationType() |
||
75 | |||
76 | /** |
||
77 | * @return string |
||
78 | 4 | */ |
|
79 | protected function getConfigurationFilePath() |
||
88 | |||
89 | 3 | /** |
|
90 | * @return null|string |
||
91 | */ |
||
92 | protected function discoverRootDirectory() |
||
108 | 3 | ||
109 | /** |
||
110 | * @return null|string |
||
111 | */ |
||
112 | protected function checkCurrentDirectory() |
||
122 | 5 | ||
123 | /** |
||
124 | 5 | * @return null|string |
|
125 | */ |
||
126 | protected function checkParentDirectories() |
||
139 | |||
140 | /** |
||
141 | * @return null|string |
||
142 | */ |
||
143 | protected function checkChildDirectories() |
||
163 | |||
164 | /** |
||
165 | * @param $directory |
||
166 | * @return bool |
||
167 | */ |
||
168 | protected function isDirectoryRoot($directory) |
||
172 | |||
173 | /** |
||
174 | * @param $directory |
||
175 | * @return bool |
||
176 | */ |
||
177 | protected function isMagentoOneDirectoryRoot($directory) |
||
181 | |||
182 | protected function isMagentoTwoDirectoryRoot($directory) |
||
186 | |||
187 | /** |
||
188 | * @param $directory |
||
189 | * @return string |
||
190 | */ |
||
191 | protected function getLocalXmlPath($directory) |
||
195 | |||
196 | /** |
||
197 | * @param $directory |
||
198 | * @return string |
||
199 | */ |
||
200 | protected function getEnvPhpPath($directory) |
||
204 | } |