classes/phing/tasks/ext/Service/Amazon/S3/S3PutTask.php
public function execute()
    {
        if (!$this->isBucketAvailable()) {
            if (!$this->getCreateBuckets()) {
                throw new BuildException('Bucket doesn\'t exist and createBuckets not specified');
            }

            if (!$this->createBucket()) {
                throw new BuildException('Bucket cannot be created');
            }
        }

        // Filesets take precedence
        if (!empty($this->_filesets)) {
            $objects = [];

            foreach ($this->_filesets as $fs) {
                if (!($fs instanceof FileSet)) {
                    continue;
                }

                $ds = $fs->getDirectoryScanner($this->getProject());
                $objects = array_merge($objects, $ds->getIncludedFiles());
            }

            $fromDir = $fs->getDir($this->getProject())->getAbsolutePath();

            if ($this->_fileNameOnly) {
                foreach ($objects as $object) {
                    $this->_source = $object;
                    $this->saveObject(basename($object), $fromDir . DIRECTORY_SEPARATOR . $object);
                }
            } else {
                foreach ($objects as $object) {
                    $this->_source = $object;
                    $this->saveObject(
                        str_replace('\\', '/', $object),
                        $fromDir . DIRECTORY_SEPARATOR . $object
                    );
                }
            }

            return;
        }

        $this->saveObject($this->getObject(), $this->getSource());
    }
public function execute()
    {
        if (!$this->isBucketAvailable()) {
            if (!$this->getCreateBuckets()) {
                throw new BuildException('Bucket doesn\'t exist and createBuckets not specified');
            }

            if (!$this->createBucket()) {
                throw new BuildException('Bucket cannot be created');
            }
        }

        // Filesets take precedence
        if (!empty($this->_filesets)) {
            $objects = [];

            foreach ($this->_filesets as $fs) {
                if (!($fs instanceof FileSet)) {
                    continue;
                }

                $ds = $fs->getDirectoryScanner($this->getProject());
                $objects = array_merge($objects, $ds->getIncludedFiles());
            }

            $fromDir = $fs->getDir($this->getProject())->getAbsolutePath();

            if ($this->_fileNameOnly) {
                foreach ($objects as $object) {
                    $this->_source = $object;
                    $this->saveObject(basename($object), $fromDir . DIRECTORY_SEPARATOR . $object);
                }
            } else {
                foreach ($objects as $object) {
                    $this->_source = $object;
                    $this->saveObject(
                        str_replace('\\', '/', $object),
                        $fromDir . DIRECTORY_SEPARATOR . $object
                    );
                }
            }

            return;
        }

        $this->saveObject($this->getObject(), $this->getSource());
    }
public function execute ( ) { if ( ! $ this -> isBucketAvailable ( ) ) { if ( ! $ this -> getCreateBuckets ( ) ) { throw new BuildException ( 'Bucket doesn\'t exist and createBuckets not specified' ) ; } if ( ! $ this -> createBucket ( ) ) { throw new BuildException ( 'Bucket cannot be created' ) ; } } // Filesets take precedence if ( ! empty ( $ this -> _filesets ) ) { $ objects = [ ] ; foreach ( $ this -> _filesets as $ fs ) { if ( ! ( $ fs instanceof FileSet ) ) { continue ; } $ ds = $ fs -> getDirectoryScanner ( $ this -> getProject ( ) ) ; $ objects = array_merge ( $ objects , $ ds -> getIncludedFiles ( ) ) ; } $ fromDir = $ fs -> getDir ( $ this -> getProject ( ) ) -> getAbsolutePath ( ) ; if ( $ this -> _fileNameOnly ) { foreach ( $ objects as $ object ) { $ this -> _source = $ object ; $ this -> saveObject ( basename ( $ object ) , $ fromDir . DIRECTORY_SEPARATOR . $ object ) ; } } else { foreach ( $ objects as $ object ) { $ this -> _source = $ object ; $ this -> saveObject ( str_replace ( '\\' , '/' , $ object ) , $ fromDir . DIRECTORY_SEPARATOR . $ object ) ; } } return ; } $ this -> saveObject ( $ this -> getObject ( ) , $ this -> getSource ( ) ) ; }
Store the object on S3

@throws BuildException
@return void
Store the object on S3