| 1 | <?php |
||
| 7 | class LocalProject implements Project |
||
| 8 | { |
||
| 9 | public function getProjectBasePath() |
||
| 10 | { |
||
| 11 | $baseDir = getcwd(); |
||
| 12 | |||
| 13 | do { |
||
| 14 | if (is_file($baseDir.self::CONFIG_FILE)) { |
||
| 15 | return $baseDir; |
||
| 16 | } |
||
| 17 | $baseDir = dirname($baseDir); |
||
| 18 | } while ($baseDir !== '/'); |
||
| 19 | |||
| 20 | throw new \Exception('Did not find `docker-compose.yml` in any parent directories.'); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function getComposeConfigPath() |
||
| 27 | |||
| 28 | public function getCurrentRelativePath() |
||
| 32 | } |
||
| 33 |