lib/Touki/FTP/FTPFactory.php
public function build(ConnectionInterface $connection)
    {
        if (!$connection->isConnected()) {
            $connection->open();
        }

        if (null === $this->wrapper) {
            $this->wrapper = new FTPWrapper($connection);
        }

        if (null === $this->manager) {
            if (null === $this->fsFactory) {
                $this->fsFactory = new FilesystemFactory(new PermissionsFactory);
            }

            $this->manager = new FTPFilesystemManager($this->wrapper, $this->fsFactory);
        }

        if (null === $this->dlVoter) {
            $this->dlVoter = new DownloaderVoter;
            $this->dlVoter->addDefaultFTPDownloaders($this->wrapper);
        }

        if (null === $this->ulVoter) {
            $this->ulVoter = new UploaderVoter;
            $this->ulVoter->addDefaultFTPUploaders($this->wrapper);
        }

        if (null === $this->crVoter) {
            $this->crVoter = new CreatorVoter;
            $this->crVoter->addDefaultFTPCreators($this->wrapper, $this->manager);
        }

        if (null === $this->deVoter) {
            $this->deVoter = new DeleterVoter;
            $this->deVoter->addDefaultFTPDeleters($this->wrapper, $this->manager);
        }

        return new FTP($this->manager, $this->dlVoter, $this->ulVoter, $this->crVoter, $this->deVoter);
    }
public function build(ConnectionInterface $connection)
    {
        if (!$connection->isConnected()) {
            $connection->open();
        }

        if (null === $this->wrapper) {
            $this->wrapper = new FTPWrapper($connection);
        }

        if (null === $this->manager) {
            if (null === $this->fsFactory) {
                $this->fsFactory = new FilesystemFactory(new PermissionsFactory);
            }

            $this->manager = new FTPFilesystemManager($this->wrapper, $this->fsFactory);
        }

        if (null === $this->dlVoter) {
            $this->dlVoter = new DownloaderVoter;
            $this->dlVoter->addDefaultFTPDownloaders($this->wrapper);
        }

        if (null === $this->ulVoter) {
            $this->ulVoter = new UploaderVoter;
            $this->ulVoter->addDefaultFTPUploaders($this->wrapper);
        }

        if (null === $this->crVoter) {
            $this->crVoter = new CreatorVoter;
            $this->crVoter->addDefaultFTPCreators($this->wrapper, $this->manager);
        }

        if (null === $this->deVoter) {
            $this->deVoter = new DeleterVoter;
            $this->deVoter->addDefaultFTPDeleters($this->wrapper, $this->manager);
        }

        return new FTP($this->manager, $this->dlVoter, $this->ulVoter, $this->crVoter, $this->deVoter);
    }
public function build ( ConnectionInterface $ connection ) { if ( ! $ connection -> isConnected ( ) ) { $ connection -> open ( ) ; } if ( null === $ this -> wrapper ) { $ this -> wrapper = new FTPWrapper ( $ connection ) ; } if ( null === $ this -> manager ) { if ( null === $ this -> fsFactory ) { $ this -> fsFactory = new FilesystemFactory ( new PermissionsFactory ) ; } $ this -> manager = new FTPFilesystemManager ( $ this -> wrapper , $ this -> fsFactory ) ; } if ( null === $ this -> dlVoter ) { $ this -> dlVoter = new DownloaderVoter ; $ this -> dlVoter -> addDefaultFTPDownloaders ( $ this -> wrapper ) ; } if ( null === $ this -> ulVoter ) { $ this -> ulVoter = new UploaderVoter ; $ this -> ulVoter -> addDefaultFTPUploaders ( $ this -> wrapper ) ; } if ( null === $ this -> crVoter ) { $ this -> crVoter = new CreatorVoter ; $ this -> crVoter -> addDefaultFTPCreators ( $ this -> wrapper , $ this -> manager ) ; } if ( null === $ this -> deVoter ) { $ this -> deVoter = new DeleterVoter ; $ this -> deVoter -> addDefaultFTPDeleters ( $ this -> wrapper , $ this -> manager ) ; } return new FTP ( $ this -> manager , $ this -> dlVoter , $ this -> ulVoter , $ this -> crVoter , $ this -> deVoter ) ; }
Creates an FTP instance

@return FTP An FTP instance
Creates an FTP instance