Skip to content

Commit

Permalink
post install script
Browse files Browse the repository at this point in the history
Signed-off-by: MarioRadu <magda_marior@yahoo.com>
  • Loading branch information
MarioRadu committed Dec 10, 2024
1 parent db767f2 commit 2e64da5
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 128 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ jobs:
- name: Install dependencies with composer
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Setup project
run: |
mv config/autoload/local.php.dist config/autoload/local.php
mv config/autoload/mail.local.php.dist config/autoload/mail.local.php
mv config/autoload/local.test.php.dist config/autoload/local.test.php
- name: Collect code coverage with PHPUnit
run: vendor/bin/phpunit --colors=always --coverage-clover clover.xml

Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,5 @@ jobs:
- name: Install dependencies with composer
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Setup project
run: |
mv config/autoload/local.php.dist config/autoload/local.php
mv config/autoload/mail.local.php.dist config/autoload/mail.local.php
mv config/autoload/local.test.php.dist config/autoload/local.test.php
- name: Run static analysis with PHPStan
run: vendor/bin/phpstan analyse
1 change: 0 additions & 1 deletion .laminas-ci/pre-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ if [[ ${COMMAND} =~ phpunit ]];then
apt-get install php"${PHP_VERSION}"-sqlite3

cp config/autoload/local.php.dist config/autoload/local.php
cp config/autoload/mail.local.php.dist config/autoload/mail.local.php
cp config/autoload/local.test.php.dist config/autoload/local.test.php

fi
35 changes: 35 additions & 0 deletions bin/composer-post-install-script.php
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');
115 changes: 0 additions & 115 deletions config/autoload/mail.local.php.dist

This file was deleted.

0 comments on commit 2e64da5

Please sign in to comment.