File tree Expand file tree Collapse file tree 2 files changed +13
-14
lines changed
Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 1111
1212function copyFile (array $ file ): void
1313{
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+
1419 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 ;
1626 } 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 ;
2628 }
2729}
2830
@@ -52,6 +54,5 @@ function getEnvironment(): string
5254];
5355
5456echo "Using environment setting: " . getEnvironment () . PHP_EOL ;
55- var_dump ("getenv('COMPOSER_DEV_MODE') " , getenv ('COMPOSER_DEV_MODE ' ));
5657
5758array_walk ($ files , 'copyFile ' );
Original file line number Diff line number Diff line change 107107 " @development-enable"
108108 ],
109109 "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"
113111 ],
114112 "development-disable" : " laminas-development-mode disable" ,
115113 "development-enable" : " laminas-development-mode enable" ,
You can’t perform that action at this time.
0 commit comments