Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mautic.corals.io/app/migrations/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mautic.corals.io/app/migrations/Version20230615101328.php
<?php

declare(strict_types=1);

namespace Mautic\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Mautic\CoreBundle\Configurator\Configurator;
use Mautic\CoreBundle\Doctrine\PreUpAssertionMigration;
use Mautic\CoreBundle\Helper\Dsn\Dsn;

final class Version20230615101328 extends PreUpAssertionMigration
{
    protected function preUpAssertions(): void
    {
        $configurator = $this->getConfigurator();

        $this->skipAssertion(
            fn () => !$configurator->isFileWritable(),
            'The local.php file is not writable. Skipping the email configuration migration.'
        );

        $this->skipAssertion(
            fn () => array_key_exists('mailer_dsn', $configurator->getParameters()),
            'The mailer_dsn parameter is already set. Skipping the email configuration migration.'
        );
    }

    public function up(Schema $schema): void
    {
        $configurator = $this->getConfigurator();
        $parameters   = $configurator->getParameters();
        $dsn          = new Dsn(
            $parameters['mailer_transport'] ?? 'smtp',
            $parameters['mailer_host'] ?? 'localhost',
            $parameters['mailer_user'] ?? null,
            $parameters['mailer_password'] ?? null,
            (int) ($parameters['mailer_port'] ?? 25),
        );

        $parameters['mailer_dsn'] = str_replace('%', '%%', (string) $dsn);

        $configurator->mergeParameters($parameters);
        $configurator->write();
    }

    private function getConfigurator(): Configurator
    {
        return $this->container->get(Configurator::class);
    }
}

Spamworldpro Mini