@param string $destination

@return SplFileInfo
517423
public function getFileInfo(string $destination): SplFileInfo
    {
        $name = Normalizer::normalizeClassname($this->getName());
        $path = rtrim($destination, '/\\').DIRECTORY_SEPARATOR.$name.'.php';

        return new SplFileInfo($path);
    }
1278729
public function clone($destination)
    {
        $fs = new Filesystem;

        if (! $fs->exists($destination)) {
            $fs->mkdir($destination, 0755);
        }

        $fs->mirror($this->source, $destination, null, $this->options);
    }
1332631
public function emitStructure($destination)
    {
        $this->treeGenerator->addPaths($this->getPaths());

        return $this->treeGenerator->generate($destination);
    }
417945
public function directory($source, $destination, $wrapper = '')
    {
        $files = gplcart_file_scan_recursive($source);

        if (empty($files)) {
            return false;
        }

        $this->set($destination, true);

        $added = 0;
        foreach ($files as $file) {

            if (is_dir($file)) {
                $added++;
                continue;
            }

            $prefix = $wrapper === '' ? '' : $wrapper . DIRECTORY_SEPARATOR;
            $relative = $prefix . substr($file, strlen($source) + 1);
            $added += (int) $this->zip->addFile($file, $relative);
        }

        $result = count($files) == $added;
        $this->zip->close();
        return $result;
    }
1141784
public function save($destination)
    {
        $fh = fopen($destination, 'wb');
        if (!$fh) {
            throw new FileOpenException('failed to open destination file: '.$destination);
        }

        if (!flock($fh, LOCK_EX | LOCK_NB, $blocked)) {
            // @codeCoverageIgnoreStart
            if ($blocked) {
                // Concurrent request has requested a lock.
                // File is being processed at the moment.
                // Warning: lock is not checked in windows.
                return false;
            }
            // @codeCoverageIgnoreEnd

            throw new FileLockException('failed to lock file: '.$destination);
        }

        $totalChunks = $this->request->getTotalChunks();

        try {
            $preProcessChunk = $this->config->getPreprocessCallback();

            for ($i = 1; $i <= $totalChunks; $i++) {
                $file = $this->getChunkPath($i);
                $chunk = fopen($file, "rb");

                if (!$chunk) {
                    throw new FileOpenException('failed to open chunk: '.$file);
                }

                if ($preProcessChunk !== null) {
                    call_user_func($preProcessChunk, $chunk);
                }

                stream_copy_to_stream($chunk, $fh);
                fclose($chunk);
            }
        } catch (\Exception $e) {
            flock($fh, LOCK_UN);
            fclose($fh);
            throw $e;
        }

        if ($this->config->getDeleteChunksOnSave()) {
            $this->deleteChunks();
        }

        flock($fh, LOCK_UN);
        fclose($fh);

        return true;
    }
1047802
public function getPrivateFile() : ?\SplFileInfo
    {
        $path = self::PRIVATE_ABSOLUTE_PATH . $this->destination . $this->privateFileName;

        if (!$this->privateFileName || !file_exists($path))
        {
            return NULL;
        }

        return new \SplFileInfo($path);
    }
1301280
protected function _unpackCurrentTar($destination)
    {
        $archiveReader = $this->_getReader();
        $list = array();

        while (!$archiveReader->eof()) {
            $header = $this->_extractFileHeader();

            if (!$header) {
                continue;
            }

            $currentFile = $destination . $header['name'];
            $dirname = dirname($currentFile);

            if (in_array($header['type'], array("0",chr(0), ''))) {

                if(!file_exists($dirname)) {
                    $mkdirResult = @mkdir($dirname, 0777, true);

                    if (false === $mkdirResult) {
                        throw new Mage_Exception('Failed to create directory ' . $dirname);
                    }
                }

                $this->_extractAndWriteFile($header, $currentFile);
                $list[] = $currentFile;

            } elseif ($header['type'] == '5') {

                if(!file_exists($dirname)) {
                    $mkdirResult = @mkdir($currentFile, $header['mode'], true);

                    if (false === $mkdirResult) {
                        throw new Mage_Exception('Failed to create directory ' . $currentFile);
                    }
                }
                $list[] = $currentFile . DS;
            } elseif ($header['type'] == '2') {

                //we do not interrupt unpack process if symlink creation failed as symlinks are not so important
                @symlink($header['symlink'], $currentFile);
            }
        }

        return $list;
    }
1146606
public function findDestination($destination)
	{
		if (is_file($destination))
		{
			return $destination;
		}

		if ($location = $this->finder->findFileReversed($destination))
		{
			return $location;
		}

		$paths = $this->finder->getPaths();

		if (empty($paths))
		{
			return false;
		}

		$last = end($paths);

		return $last.ltrim($destination, DIRECTORY_SEPARATOR);
	}
1111671
public function getUnsubscribeFrame($destination, $subscriptionId = null)
    {
        $frame = $this->createFrame('UNSUBSCRIBE');
        $frame['destination'] = $destination;
        $frame['id'] = $subscriptionId;
        return $frame;
    }
540026
public function createTmpFile(string $suffix = ''): \SplFileInfo
    {
        $file = uniqid();
        if ($suffix) {
            $file .= '-' . $suffix;
        }
        return $this->createFile($file);
    }
1031674
private function exportIntoFolder(\core_kernel_classes_Class $deliveryClass, $destination)
    {
        /** @var \core_kernel_classes_Resource $delivery */
        foreach ($deliveryClass->getInstances(false) as $delivery) {
            (new SingleDeliveryResultsExporter(
                $delivery,
                $this->resultsService,
                (new ColumnsProvider($delivery, $this->resultsService))
            ))
                ->setServiceLocator($this->getServiceLocator())
                ->export($destination);
        }

        if ($subClasses = $deliveryClass->getSubClasses(false)) {
            /** @var \core_kernel_classes_Class $subClass */
            foreach ($subClasses as $subClass) {
                $newDestination = $destination . DIRECTORY_SEPARATOR . \tao_helpers_Display::textCleaner($subClass->getLabel(), '*');
                mkdir($newDestination);
                $this->exportIntoFolder($subClass, $newDestination);
            }
        }
    }
1107652
public function to($destination, array $defaults = [])
    {
        if ($this->name === null) {
            $this->name = strtolower(
                str_replace(['\\', '::'], '_', $destination)
            );
        }

        $this->destination = $destination;
        $this->defaults    = $defaults;
        return $this;
    }
806593
public function setDestination($destination)
    {
        if ($destination instanceof Closure) {
            $this->callbacks['destination'] = $destination;
        } else {
            $this->options = self::parsePath($destination) + $this->options;
        }

        return $this;
    }
596654
public function linkVerified(string $destination, array $args = []): ?string
    {
        $link = $this->link($destination, $args);

        /** @var Presenter $presenter */
        $presenter = $this->getPresenter();

        return $presenter->getVerifier()->isLinkVerified($presenter->getLastCreatedRequest(), $this) ? $link : null;
    }
1287482
public function checkout($destination)
    {
        $repository = $this->credentials->getCurrentRepository();

        $arguments = [
            $this->quote($repository->repository),
            '-b '.$repository->branch,
            $this->quote($destination),
        ];

        return $this->clone($arguments, $this->getCredentials());
    }
982262
private function getFilenameFromFile(SplFileInfo $file) : string
    {
        return substr($file->getRelativePathname(), 0, -(strlen($this->fileExtension) + 1));
    }
143347
public function copyDirectory($directory, $destination)
    {
        $files = $this->fileSystem->allFiles($directory);
        $fileDeployed = false;
        $this->fileSystem->copyDirectory($directory, $destination);

        foreach ($files as $file) {
            $fileContents = $this->fileSystem->get($file);
            $fileDeployed = $this->fileSystem->put($destination.'/'.$file->getRelativePathname(), $fileContents);
        }

        return $fileDeployed;
    }