File tree 2 files changed +13
-14
lines changed
2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 11
11
12
12
function copyFile (array $ file ): void
13
13
{
14
+ if (! in_array (getEnvironment (), $ file ['environment ' ])) {
15
+ echo "Skipping the copy of {$ file ['source ' ]} due to environment settings. " . PHP_EOL ;
16
+ return ;
17
+ }
18
+
14
19
if (is_readable ($ file ['destination ' ])) {
15
- echo "File {$ file ['destination ' ]} already exists. " . PHP_EOL ;
20
+ echo "File {$ file ['destination ' ]} already exists. Skipping... " . PHP_EOL ;
21
+ return ;
22
+ }
23
+
24
+ if (! copy ($ file ['source ' ], $ file ['destination ' ])) {
25
+ echo "Cannot copy {$ file ['source ' ]} file to {$ file ['destination ' ]}" . PHP_EOL ;
16
26
} else {
17
- if (! in_array (getEnvironment (), $ file ['environment ' ])) {
18
- echo "Skipping the copy of {$ file ['source ' ]} due to environment settings. " . PHP_EOL ;
19
- } else {
20
- if (! copy ($ file ['source ' ], $ file ['destination ' ])) {
21
- echo "Cannot copy {$ file ['source ' ]} file to {$ file ['destination ' ]}" . PHP_EOL ;
22
- } else {
23
- echo "File {$ file ['source ' ]} copied successfully to {$ file ['destination ' ]}. " . PHP_EOL ;
24
- }
25
- }
27
+ echo "File {$ file ['source ' ]} copied successfully to {$ file ['destination ' ]}. " . PHP_EOL ;
26
28
}
27
29
}
28
30
@@ -52,6 +54,5 @@ function getEnvironment(): string
52
54
];
53
55
54
56
echo "Using environment setting: " . getEnvironment () . PHP_EOL ;
55
- var_dump ("getenv('COMPOSER_DEV_MODE') " , getenv ('COMPOSER_DEV_MODE ' ));
56
57
57
58
array_walk ($ files , 'copyFile ' );
Original file line number Diff line number Diff line change 107
107
" @development-enable"
108
108
],
109
109
"post-update-cmd" : [
110
- " laminas-development-mode status" ,
111
- " php bin/composer-post-install-script.php" ,
112
- " laminas-development-mode status"
110
+ " php bin/composer-post-install-script.php"
113
111
],
114
112
"development-disable" : " laminas-development-mode disable" ,
115
113
"development-enable" : " laminas-development-mode enable" ,
You can’t perform that action at this time.
0 commit comments