| 1 | <?php |
||
| 6 | class ConfigWriter implements WriterInterface |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * @var Filesystem |
||
| 10 | */ |
||
| 11 | private $filesystem; |
||
| 12 | /** |
||
| 13 | * @var |
||
| 14 | */ |
||
| 15 | private $config_path; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * ConfigWriter constructor. |
||
| 19 | * @param Filesystem $filesystem |
||
| 20 | * @param string $config_path |
||
| 21 | */ |
||
| 22 | 4 | public function __construct(Filesystem $filesystem, $config_path) |
|
| 27 | |||
| 28 | /** |
||
| 29 | * Get the key file and contents. |
||
| 30 | * |
||
| 31 | * @return array |
||
| 32 | */ |
||
| 33 | 4 | protected function getConfigFile() |
|
| 37 | |||
| 38 | /** |
||
| 39 | * Check if the config file exists |
||
| 40 | * |
||
| 41 | * @return bool |
||
| 42 | */ |
||
| 43 | 4 | protected function configExists() |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Returns current config as string |
||
| 50 | * |
||
| 51 | * @return string |
||
| 52 | */ |
||
| 53 | 2 | public function getCurrentConfig() |
|
| 60 | |||
| 61 | /** |
||
| 62 | * Saves config as current config |
||
| 63 | * @param string $content |
||
| 64 | * @return void |
||
| 65 | */ |
||
| 66 | 2 | public function setCurrentConfig($content) |
|
| 73 | } |
||
| 74 |