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/vendor/oneup/uploader-bundle/src/Uploader/Gaufrette/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mautic.corals.io/vendor/oneup/uploader-bundle/src/Uploader/Gaufrette/StreamManager.php
<?php

declare(strict_types=1);

namespace Oneup\UploaderBundle\Uploader\Gaufrette;

use Gaufrette\Filesystem;
use Gaufrette\FilesystemInterface;
use Gaufrette\Stream;
use Gaufrette\Stream\Local as LocalStream;
use Gaufrette\StreamMode;
use Oneup\UploaderBundle\Uploader\File\FileInterface;
use Oneup\UploaderBundle\Uploader\File\GaufretteFile;

class StreamManager
{
    /**
     * @var int
     */
    public $buffersize;

    /**
     * @var FilesystemInterface|Filesystem
     */
    protected $filesystem;

    protected function createSourceStream(FileInterface $file): Stream
    {
        if ($file instanceof GaufretteFile) {
            // The file is always streamable as the chunk storage only allows
            // adapters that implement StreamFactory
            return $file->createStream();
        }

        return new LocalStream($file->getPathname());
    }

    protected function ensureRemotePathExists(string $path): void
    {
        if (!$this->filesystem->has($path)) {
            $this->filesystem->write($path, '', true);
        }
    }

    protected function openStream(Stream $stream, string $mode): bool
    {
        // always use binary mode
        $mode .= 'b+';

        return $stream->open(new StreamMode($mode));
    }

    protected function stream(FileInterface $file, Stream $dst): void
    {
        $src = $this->createSourceStream($file);

        // always use reading only for the source
        $this->openStream($src, 'r');

        while (!$src->eof()) {
            $data = $src->read($this->buffersize);
            $dst->write($data);
        }

        $dst->close();
        $src->close();
    }
}

Spamworldpro Mini