1 | <?php |
||
26 | class Locator { |
||
27 | |||
28 | /** |
||
29 | * absolute path to ownCloud root |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $ownCloudRootPath; |
||
33 | |||
34 | /** |
||
35 | * absolute path to updater root |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $updaterRootPath; |
||
39 | |||
40 | /** |
||
41 | * |
||
42 | * @param string $baseDir |
||
43 | */ |
||
44 | public function __construct($baseDir){ |
||
48 | |||
49 | public function getOwnCloudRootPath(){ |
||
50 | return $this->ownCloudRootPath; |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * expected items in the core |
||
55 | * @return string[] |
||
56 | */ |
||
57 | public function getRootDirContent(){ |
||
87 | |||
88 | public function getUpdaterContent(){ |
||
106 | |||
107 | /** |
||
108 | * Absolute path to core root dir content |
||
109 | * @return array |
||
110 | */ |
||
111 | public function getRootDirItems(){ |
||
119 | |||
120 | /** |
||
121 | * Absolute path |
||
122 | * @return string |
||
123 | * @throws \Exception |
||
124 | */ |
||
125 | public function getDataDir(){ |
||
126 | $container = Application::$container; |
||
127 | if (isset($container['utils.configReader']) && $container['utils.configReader']->getIsLoaded()){ |
||
128 | return $container['utils.configReader']->getByPath('system.datadirectory'); |
||
129 | } |
||
130 | |||
131 | // Fallback case |
||
132 | include $this->getPathToConfigFile(); |
||
133 | if (isset($CONFIG['datadirectory'])){ |
||
|
|||
134 | return $CONFIG['datadirectory']; |
||
135 | } |
||
136 | |||
137 | // Something went wrong |
||
138 | throw new \Exception('Unable to detect datadirectory'); |
||
139 | } |
||
140 | |||
141 | /** |
||
142 | * Absolute path to updater root dir |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getUpdaterBaseDir(){ |
||
148 | |||
149 | /** |
||
150 | * Absolute path to create a core and apps backups |
||
151 | * @return string |
||
152 | */ |
||
153 | public function getCheckpointDir(){ |
||
156 | |||
157 | /** |
||
158 | * Absolute path to store downloaded packages |
||
159 | * @return string |
||
160 | */ |
||
161 | public function getDownloadBaseDir(){ |
||
164 | |||
165 | public function getExtractionBaseDir(){ |
||
168 | |||
169 | /** |
||
170 | * |
||
171 | * @return string |
||
172 | */ |
||
173 | public function getPathToOccFile(){ |
||
176 | |||
177 | /** |
||
178 | * |
||
179 | * @return string |
||
180 | */ |
||
181 | public function getInstalledVersion(){ |
||
187 | |||
188 | /** |
||
189 | * |
||
190 | * @return string |
||
191 | */ |
||
192 | public function getChannelFromVersionsFile(){ |
||
198 | |||
199 | /** |
||
200 | * |
||
201 | * @return string |
||
202 | */ |
||
203 | public function getBuild(){ |
||
209 | |||
210 | public function getPathtoConfigFiles($filePostfix = 'config.php'){ |
||
216 | |||
217 | public function getPathToConfigFile(){ |
||
220 | |||
221 | /** |
||
222 | * |
||
223 | * @return string |
||
224 | */ |
||
225 | public function getPathToVersionFile(){ |
||
228 | |||
229 | } |
||
230 |
This check looks for calls to
isset(...)
orempty()
on variables that are yet undefined. These calls will always produce the same result and can be removed.This is most likely caused by the renaming of a variable or the removal of a function/method parameter.