@@ -1,44 +1,44 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -echo ' Configuring VoidFramework...'. PHP_EOL; |
|
3 | +echo ' Configuring VoidFramework...'.PHP_EOL; |
|
4 | 4 | |
5 | -function dir_copy (string $from, string $to): bool |
|
5 | +function dir_copy(string $from, string $to): bool |
|
6 | 6 | { |
7 | - if (!is_dir ($from)) |
|
7 | + if (!is_dir($from)) |
|
8 | 8 | return false; |
9 | 9 | |
10 | - if (!is_dir ($to)) |
|
11 | - mkdir ($to); |
|
10 | + if (!is_dir($to)) |
|
11 | + mkdir($to); |
|
12 | 12 | |
13 | - foreach (array_slice (scandir ($from), 2) as $file) |
|
14 | - if (is_dir ($f = $from .'/'. $file)) |
|
15 | - dir_copy ($f, $to .'/'. $file); |
|
13 | + foreach (array_slice(scandir($from), 2) as $file) |
|
14 | + if (is_dir($f = $from.'/'.$file)) |
|
15 | + dir_copy($f, $to.'/'.$file); |
|
16 | 16 | |
17 | - else copy ($f, $to .'/'. $file); |
|
17 | + else copy($f, $to.'/'.$file); |
|
18 | 18 | |
19 | 19 | return true; |
20 | 20 | } |
21 | 21 | |
22 | -$info = file_exists (QERO_DIR .'/qero-info.json') ? |
|
23 | - json_decode (file_get_contents (QERO_DIR .'/qero-info.json'), true) : array (); |
|
22 | +$info = file_exists(QERO_DIR.'/qero-info.json') ? |
|
23 | + json_decode (file_get_contents(QERO_DIR.'/qero-info.json'), true) : array(); |
|
24 | 24 | |
25 | 25 | $info['scripts']['start'] = '"qero-packages/winforms-php/VoidFramework/core/VoidCore.exe" "app/start.php"'; |
26 | 26 | |
27 | -file_put_contents (QERO_DIR .'/qero-info.json', json_encode ($info, defined ('JSON_PRETTY_PRINT') ? |
|
27 | +file_put_contents(QERO_DIR.'/qero-info.json', json_encode($info, defined('JSON_PRETTY_PRINT') ? |
|
28 | 28 | constant ('JSON_PRETTY_PRINT') : 0)); |
29 | -file_put_contents (QERO_DIR .'/start.bat', '@echo off |
|
29 | +file_put_contents(QERO_DIR.'/start.bat', '@echo off |
|
30 | 30 | '. $info['scripts']['start']); |
31 | 31 | |
32 | -if (!is_dir (QERO_DIR .'/app')) |
|
32 | +if (!is_dir(QERO_DIR.'/app')) |
|
33 | 33 | { |
34 | - echo ' Configuring application...'. PHP_EOL; |
|
34 | + echo ' Configuring application...'.PHP_EOL; |
|
35 | 35 | |
36 | - mkdir (QERO_DIR .'/app'); |
|
37 | - dir_copy (__DIR__ .'/app_bundle', QERO_DIR .'/app'); |
|
36 | + mkdir(QERO_DIR.'/app'); |
|
37 | + dir_copy(__DIR__.'/app_bundle', QERO_DIR.'/app'); |
|
38 | 38 | } |
39 | 39 | |
40 | -Qero\dir_delete (__DIR__ .'/app_bundle'); |
|
41 | -unlink (__FILE__); |
|
40 | +Qero\dir_delete(__DIR__.'/app_bundle'); |
|
41 | +unlink(__FILE__); |
|
42 | 42 | |
43 | -echo ' Configuration completed'. PHP_EOL . |
|
44 | - ' Thank for installing winforms-php/VoidFramework!'. PHP_EOL . PHP_EOL; |
|
43 | +echo ' Configuration completed'.PHP_EOL. |
|
44 | + ' Thank for installing winforms-php/VoidFramework!'.PHP_EOL.PHP_EOL; |
@@ -4,17 +4,22 @@ |
||
4 | 4 | |
5 | 5 | function dir_copy (string $from, string $to): bool |
6 | 6 | { |
7 | - if (!is_dir ($from)) |
|
8 | - return false; |
|
7 | + if (!is_dir ($from)) { |
|
8 | + return false; |
|
9 | + } |
|
9 | 10 | |
10 | - if (!is_dir ($to)) |
|
11 | - mkdir ($to); |
|
11 | + if (!is_dir ($to)) { |
|
12 | + mkdir ($to); |
|
13 | + } |
|
12 | 14 | |
13 | - foreach (array_slice (scandir ($from), 2) as $file) |
|
14 | - if (is_dir ($f = $from .'/'. $file)) |
|
15 | + foreach (array_slice (scandir ($from), 2) as $file) { |
|
16 | + if (is_dir ($f = $from .'/'. $file)) |
|
15 | 17 | dir_copy ($f, $to .'/'. $file); |
18 | + } |
|
16 | 19 | |
17 | - else copy ($f, $to .'/'. $file); |
|
20 | + else { |
|
21 | + copy ($f, $to .'/'. $file); |
|
22 | + } |
|
18 | 23 | |
19 | 24 | return true; |
20 | 25 | } |