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