diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 293bb8eb..59c4b08d 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -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 diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 6a700f5d..ee7251d0 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -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 diff --git a/bin/composer-post-install-script.php b/bin/composer-post-install-script.php new file mode 100644 index 00000000..af2e8a93 --- /dev/null +++ b/bin/composer-post-install-script.php @@ -0,0 +1,35 @@ + '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'); diff --git a/composer.json b/composer.json index f12aa84e..d4a4adec 100644 --- a/composer.json +++ b/composer.json @@ -86,6 +86,9 @@ "post-create-project-cmd": [ "@development-enable" ], + "post-update-cmd": [ + "php bin/composer-post-install-script.php" + ], "development-disable": "laminas-development-mode disable", "development-enable": "laminas-development-mode enable", "development-status": "laminas-development-mode status", diff --git a/config/autoload/local.php.dist b/config/autoload/local.php.dist index 9935f62b..455334fc 100644 --- a/config/autoload/local.php.dist +++ b/config/autoload/local.php.dist @@ -26,13 +26,13 @@ $databases = [ ]; return [ - 'application' => [ + 'application' => [ 'name' => $app['name'] ?? '', 'url' => $baseUrl, ], - 'databases' => $databases, - 'doctrine' => [ - 'connection' => [ + 'databases' => $databases, + 'doctrine' => [ + 'connection' => [ 'orm_default' => [ 'params' => $databases['default'], ], diff --git a/config/autoload/mail.local.php.dist b/config/autoload/mail.local.php.dist deleted file mode 100644 index 9ef3b308..00000000 --- a/config/autoload/mail.local.php.dist +++ /dev/null @@ -1,80 +0,0 @@ - [ - //the key is the mail service name, this is the default one, which does not extend any configuration - 'default' => [ - //message configuration - 'message_options' => [ - //from email address of the email - 'from' => '', - //from name to be displayed instead of from address - 'from_name' => '', - //reply-to email address of the email - 'reply_to' => '', - //replyTo name to be displayed instead of the address - 'reply_to_name' => '', - //destination email address as string or a list of email addresses - 'to' => [], - //copy destination addresses - 'cc' => [], - //hidden copy destination addresses - 'bcc' => [], - //email subject - 'subject' => '', - //body options - content can be plain text, HTML - 'body' => [ - 'content' => '', - 'charset' => 'utf-8', - ], - //attachments config - 'attachments' => [ - 'files' => [], - 'dir' => [ - 'iterate' => false, - 'path' => 'data/mail/attachments', - 'recursive' => false, - ], - ], - ], - /** - * the mail transport to use can be any class implementing - * Symfony\Component\Mailer\Transport\TransportInterface - * - * for standard mail transports, you can use these aliases: - * - sendmail => Symfony\Component\Mailer\Transport\SendmailTransport - * - esmtp => Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport - * - * defaults to sendmail - **/ - 'transport' => 'sendmail', - //options that will be used only if esmtp adapter is used - 'smtp_options' => [ - //hostname or IP address of the mail server - 'host' => '', - //port of the mail server - 587 or 465 for secure connections - 'port' => 587, - 'connection_config' => [ - //the smtp authentication identity - 'username' => '', - //the smtp authentication credential - 'password' => '', - //to disable auto_tls set tls key to false - //it's not recommended to disable TLS while connecting to an SMTP server - 'tls' => null, - ], - ], - ], - // option to log the SENT emails - 'log' => [ - 'sent' => getcwd() . '/log/mail/sent.log', - ], - ], -];