Conditions | 2 |
Paths | 5 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
11 | public function actionIndex(): void |
||
12 | { |
||
13 | Cli::printer("Put the file containing the array into a directory\n", "green"); |
||
14 | Cli::printer("Enter filename with php Array: ", "magneta"); |
||
15 | $filename = trim(fgets(fopen("php://stdin", "r"))); |
||
16 | |||
17 | try { |
||
18 | $array = include("config/$filename.php"); |
||
19 | $yaml = Yaml::dump($array); |
||
20 | file_put_contents("config/$filename.yml", $yaml); |
||
21 | |||
22 | Cli::printer("Yml was created" . PHP_EOL, "cyan", ); |
||
23 | } catch (Exception $e) { |
||
24 | echo 'Exception: ', $e->getMessage(), "\n"; |
||
25 | } |
||
28 |