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/.laminas-ci/pre-run.sh b/.laminas-ci/pre-run.sh index 4a356038..34626d54 100755 --- a/.laminas-ci/pre-run.sh +++ b/.laminas-ci/pre-run.sh @@ -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 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/config/autoload/mail.local.php.dist b/config/autoload/mail.local.php.dist deleted file mode 100644 index b3b25676..00000000 --- a/config/autoload/mail.local.php.dist +++ /dev/null @@ -1,115 +0,0 @@ - [ - //the key is the mail service name, this is the default one, which does not extends any configuration - 'default' => [ - //tells which other mail service configuration to extend - 'extends' => null, - - /** - * 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 - * - smtp => Symfony\Component\Mailer\Transport\Smtp\SmtpTransport - * - * defaults to sendmail - **/ - - 'transport' => Symfony\Component\Mailer\Transport\SendmailTransport::class, - - //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, - ] - ], - ], - - //options that will be used only if Symfony\Component\Mailer\Transport\Smtp\SmtpTransport 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 class used for authentication - //the value can be one of smtp, plain, login or crammd5 - 'connection_class' => 'login', - - 'connection_config' => [ - - //the smtp authentication identity - //'username' => '', - - //the smtp authentication credential - //'password' => '', - - //the encryption type to be used, ssl or tls - //null should be used to disable SSL - 'ssl' => 'tls', - ] - ], - ], - // option to log the SENT emails - 'log' => [ - 'sent' => getcwd() . '/log/mail/sent.log' - ], - - /** - * You can define other mail services here, with the same structure as the default block - * you can even extend from the default block, and overwrite only the differences - */ - ], -];