404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.117.145.67: ~ $
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Mailer\Tests\Transport\Smtp;

use Symfony\Component\Mailer\Exception\TransportException;
use Symfony\Component\Mailer\Transport\Smtp\Stream\AbstractStream;

class DummyStream extends AbstractStream
{
    private string $nextResponse;
    private array $commands = [];
    private bool $closed = true;

    public function initialize(): void
    {
        $this->closed = false;
        $this->nextResponse = '220 localhost ESMTP';
    }

    public function disableTls(): static
    {
        return $this;
    }

    public function isTLS(): bool
    {
        return false;
    }

    public function setHost(string $host): static
    {
        return $this;
    }

    public function setPort(int $port): static
    {
        return $this;
    }

    public function write(string $bytes, $debug = true): void
    {
        if ($this->closed) {
            throw new TransportException('Unable to write bytes on the wire.');
        }

        $this->commands[] = $bytes;

        if (str_starts_with($bytes, 'EHLO')) {
            $this->nextResponse = '250 localhost';
        } elseif (str_starts_with($bytes, 'DATA')) {
            $this->nextResponse = '354 Enter message, ending with "." on a line by itself';
        } elseif (str_starts_with($bytes, 'QUIT')) {
            $this->nextResponse = '221 Goodbye';
        } else {
            $this->nextResponse = '250 OK';
        }
    }

    public function readLine(): string
    {
        return $this->nextResponse."\r\n";
    }

    public function flush(): void
    {
    }

    /**
     * @return string[]
     */
    public function getCommands(): array
    {
        return $this->commands;
    }

    public function clearCommands(): void
    {
        $this->commands = [];
    }

    protected function getReadConnectionDescription(): string
    {
        return 'null';
    }

    public function close(): void
    {
        $this->closed = true;
    }

    public function isClosed(): bool
    {
        return $this->closed;
    }

    public function terminate(): void
    {
        parent::terminate();
        $this->closed = true;
    }
}

Filemanager

Name Type Size Permission Actions
Stream Folder 0755
DummyStream.php File 2.43 KB 0644
EsmtpTransportFactoryTest.php File 4.39 KB 0644
EsmtpTransportTest.php File 2.65 KB 0644
SmtpTransportTest.php File 6.47 KB 0644