| Conditions | 7 |
| Paths | 16 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public static function locate($configOption) |
||
| 16 | { |
||
| 17 | if (is_null($configOption)) { |
||
|
|
|||
| 18 | $configOption = ''; |
||
| 19 | } |
||
| 20 | |||
| 21 | $configurationFile = static::CONFIG_FILENAME; |
||
| 22 | if (is_dir($configOption)) { |
||
| 23 | $configurationFile = $configOption . DIRECTORY_SEPARATOR . $configurationFile; |
||
| 24 | } |
||
| 25 | if (file_exists($configOption) && is_file($configOption)) { |
||
| 26 | return realpath($configOption); |
||
| 27 | } |
||
| 28 | if (file_exists($configurationFile)) { |
||
| 29 | return realpath($configurationFile); |
||
| 30 | } |
||
| 31 | if (file_exists($configurationFile . '.dist')) { |
||
| 32 | return realpath($configurationFile . '.dist'); |
||
| 33 | } |
||
| 34 | |||
| 35 | return null; |
||
| 36 | } |
||
| 38 |