-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #364 from dotkernel/issue-363
Composer post install script
- Loading branch information
Showing
5 changed files
with
44 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
// phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols | ||
|
||
function copyFile(array $file): void | ||
{ | ||
if (is_readable($file['destination'])) { | ||
echo "File {$file['destination']} already exists." . PHP_EOL; | ||
} else { | ||
if (! copy($file['source'], $file['destination'])) { | ||
echo "Cannot copy {$file['source']} file to {$file['destination']}" . PHP_EOL; | ||
} else { | ||
echo "File {$file['source']} copied successfully to {$file['destination']}." . PHP_EOL; | ||
} | ||
} | ||
} | ||
|
||
$files = [ | ||
[ | ||
'source' => 'config/autoload/local.php.dist', | ||
'destination' => 'config/autoload/local.php', | ||
], | ||
[ | ||
'source' => 'config/autoload/local.test.php.dist', | ||
'destination' => 'config/autoload/local.test.php', | ||
], | ||
[ | ||
'source' => 'vendor/dotkernel/dot-mail/config/mail.global.php.dist', | ||
'destination' => 'config/autoload/mail.global.php', | ||
], | ||
]; | ||
|
||
array_walk($files, 'copyFile'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters