public function transport(array $config = array()) {
        if (!$this->_transporter) {
            throw new InvalidArgumentException('No Transporter has been defined');
        }

        $localFiles = $this->getAllFiles();
        $transportedFiles = array();
        $error = null;

        if (!$localFiles) {
            throw new IoException('No files to transport');
        }

        foreach ($localFiles as $i => $file) {
            try {
                $tempConfig = $config;

                if (isset($tempConfig[$i])) {
                    $tempConfig = array_merge($tempConfig, $tempConfig[$i]);
                }

                $transportedFiles[] = $this->getTransporter()->transport($file, $tempConfig);

            } catch (Exception $e) {
                $error = $e->getMessage();
                break;
            }
        }

        // Throw error and rollback
        if ($error) {
            $this->rollback();

            if ($transportedFiles) {
                foreach ($transportedFiles as $path) {
                    $this->getTransporter()->delete($path);
                }
            }

            throw new TransportationException($error);
        }

        return $transportedFiles;
    }
public function transport(array $config = array()) {
        if (!$this->_transporter) {
            throw new InvalidArgumentException('No Transporter has been defined');
        }

        $localFiles = $this->getAllFiles();
        $transportedFiles = array();
        $error = null;

        if (!$localFiles) {
            throw new IoException('No files to transport');
        }

        foreach ($localFiles as $i => $file) {
            try {
                $tempConfig = $config;

                if (isset($tempConfig[$i])) {
                    $tempConfig = array_merge($tempConfig, $tempConfig[$i]);
                }

                $transportedFiles[] = $this->getTransporter()->transport($file, $tempConfig);

            } catch (Exception $e) {
                $error = $e->getMessage();
                break;
            }
        }

        // Throw error and rollback
        if ($error) {
            $this->rollback();

            if ($transportedFiles) {
                foreach ($transportedFiles as $path) {
                    $this->getTransporter()->delete($path);
                }
            }

            throw new TransportationException($error);
        }

        return $transportedFiles;
    }
public function transport ( array $ config = array ( ) ) { if ( ! $ this -> _transporter ) { throw new InvalidArgumentException ( 'No Transporter has been defined' ) ; } $ localFiles = $ this -> getAllFiles ( ) ; $ transportedFiles = array ( ) ; $ error = null ; if ( ! $ localFiles ) { throw new IoException ( 'No files to transport' ) ; } foreach ( $ localFiles as $ i => $ file ) { try { $ tempConfig = $ config ; if ( isset ( $ tempConfig [ $ i ] ) ) { $ tempConfig = array_merge ( $ tempConfig , $ tempConfig [ $ i ] ) ; } $ transportedFiles [ ] = $ this -> getTransporter ( ) -> transport ( $ file , $ tempConfig ) ; } catch ( Exception $ e ) { $ error = $ e -> getMessage ( ) ; break ; } } // Throw error and rollback if ( $ error ) { $ this -> rollback ( ) ; if ( $ transportedFiles ) { foreach ( $ transportedFiles as $ path ) { $ this -> getTransporter ( ) -> delete ( $ path ) ; } } throw new TransportationException ( $ error ) ; } return $ transportedFiles ; }
Transport the file using the Transporter object.
An array of configuration can be passed to override the transporter configuration.
If the configuration is numerically indexed, individual file overrides can be set.

@param array $config
@return array
@throws \Transit\Exception\IoException
@throws \Transit\Exception\TransportationException
@throws \InvalidArgumentException
Transport the file using the Transporter object . An array of configuration can be passed to override the transporter configuration . If the configuration is numerically indexed individual file overrides can be set .