Stores an object on S3

Provides common methods and properties to all of the S3 tasks

version | $Id: 8d435567a86c67e90bc1ef4e54c7affa78b97fc0 $
package | phing.tasks.ext
author | Andrei Serdeliuc
extends | Service_Amazon_S3
copyright | 2001,2002 THYRELL. All rights reserved

### Methods

## Property getter

    __get(mixed $var) : void

Inherited

If the property hasn't been previously set (through the task call normally), it will try to load it from the project

This way, we can define global properties for the "Amazon" service, like key and secret

access | public
inherited_from | \Service_Amazon::__get()
inherited_from | \Service_Amazon_S3::__get()

### Parameters

#### $var

`mixed`

## __isset()

    __isset($var)

Inherited

inherited_from | \Service_Amazon::__isset()
inherited_from | \Service_Amazon_S3::__isset()

### Parameters

#### $var

## __set()

    __set($var, $val)

Inherited

inherited_from | \Service_Amazon::__set()
inherited_from | \Service_Amazon_S3::__set()

### Parameters

#### $var

#### $val

## Create a bucket

    createBucket() : void

Inherited

access | public
inherited_from | \Service_Amazon_S3::createBucket()

## creator for _filesets

    createFileset() : \FileSet

access | public

### Returns

`\FileSet`

## Store the object on S3

    execute() : void

access | public

## getAcl()

    getAcl()

## getBucket()

    getBucket()

Inherited

inherited_from | \Service_Amazon_S3::getBucket()

## Returns an instance of Services_Amazon_S3_Resource_Bucket

    getBucketInstance() : \Services_Amazon_S3_Resource_Bucket

Inherited

access | public
inherited_from | \Service_Amazon_S3::getBucketInstance()

### Returns

`\Services_Amazon_S3_Resource_Bucket`

## We only instantiate the client once per task call

    getClient() : \Services_Amazon_S3

Inherited

access | public
inherited_from | \Service_Amazon_S3::getClient()

### Returns

`\Services_Amazon_S3`

## getContent()

    getContent()

## getContentType()

    getContentType()

## getCreateBuckets()

    getCreateBuckets()

## Returns the textual description of the task

    getDescription() : string

Inherited

inherited_from | \Task::getDescription()
inherited_from | \Service_Amazon::getDescription()
inherited_from | \Service_Amazon_S3::getDescription()

### Returns

`string`The text description of the task

## getter for _filesets

    getFilesets() : array

access | public

### Returns

`array`

## getKey()

    getKey()

Inherited

inherited_from | \Service_Amazon::getKey()
inherited_from | \Service_Amazon_S3::getKey()

## Returns the location within the buildfile this task occurs.

    getLocation() : \Location

Inherited

Used by BuildException to give detailed error messages.

inherited_from | \Task::getLocation()
inherited_from | \Service_Amazon::getLocation()
inherited_from | \Service_Amazon_S3::getLocation()

### Returns

`\Location`The location object describing the position of this task within the buildfile.

## getObject()

    getObject()

## Get the contents of an object (by it's name)

    getObjectContents(string $object) : mixed

Inherited

access | public
inherited_from | \Service_Amazon_S3::getObjectContents()

### Parameters

#### $object

`string`

### Returns

`mixed`

## Determines what we're going to store in the object

    getObjectData() : string

If _content has been set, this will get stored, otherwise, we read from _source

access | public

### Returns

`string`

## Returns an instance of Services_Amazon_S3_Resource_Object

    getObjectInstance(mixed $object) : \Services_Amazon_S3_Resource_Object

Inherited

access | public
inherited_from | \Service_Amazon_S3::getObjectInstance()

### Parameters

#### $object

`mixed`

### Returns

`\Services_Amazon_S3_Resource_Object`

## Returns the owning target of this task.

    getOwningTarget() : \Target

Inherited

inherited_from | \Task::getOwningTarget()
inherited_from | \Service_Amazon::getOwningTarget()
inherited_from | \Service_Amazon_S3::getOwningTarget()

### Returns

`\Target`The target object that owns this task

## Returns a reference to current project

    getProject() : \Project

Inherited

inherited_from | \ProjectComponent::getProject()
inherited_from | \Task::getProject()
inherited_from | \Service_Amazon::getProject()
inherited_from | \Service_Amazon_S3::getProject()

### Returns

`\Project`Reference to current porject object

## Returns the wrapper object for runtime configuration

    getRuntimeConfigurableWrapper() : \RuntimeConfigurable

Inherited

inherited_from | \Task::getRuntimeConfigurableWrapper()
inherited_from | \Service_Amazon::getRuntimeConfigurableWrapper()
inherited_from | \Service_Amazon_S3::getRuntimeConfigurableWrapper()

### Returns

`\RuntimeConfigurable`The wrapper object used by this task

## getSecret()

    getSecret()

Inherited

inherited_from | \Service_Amazon::getSecret()
inherited_from | \Service_Amazon_S3::getSecret()

## getSource()

    getSource()

## Returns the name of task, used only for log messages

    getTaskName() : string

Inherited

inherited_from | \Task::getTaskName()
inherited_from | \Service_Amazon::getTaskName()
inherited_from | \Service_Amazon_S3::getTaskName()

### Returns

`string`Name of this task

## Returns the name of the task under which it was invoked, usually the XML tagname

    getTaskType() : string

Inherited

inherited_from | \Task::getTaskType()
inherited_from | \Service_Amazon::getTaskType()
inherited_from | \Service_Amazon_S3::getTaskType()

### Returns

`string`The type of this task (XML Tag)

## Called by the parser to let the task initialize properly.

    init()

Inherited

Should throw a BuildException if something goes wrong with the build

This is abstract here, but may not be overloaded by subclasses.

inherited_from | \Task::init()
inherited_from | \Service_Amazon::init()
inherited_from | \Service_Amazon_S3::init()

### Exceptions

`\BuildException` |

## Check if the current bucket is available

    isBucketAvailable() : bool

Inherited

access | public
inherited_from | \Service_Amazon_S3::isBucketAvailable()

### Returns

`bool`

## Check if the object already exists in the current bucket

    isObjectAvailable(mixed $object) : bool

Inherited

access | public
inherited_from | \Service_Amazon_S3::isObjectAvailable()

### Parameters

#### $object

`mixed`

### Returns

`bool`

## Provides a project level log event to the task.

    log(string $msg, integer $level)

Inherited

see | \global\BuildEvent
see | \global\BuildListener
inherited_from | \Task::log()
inherited_from | \Service_Amazon::log()
inherited_from | \Service_Amazon_S3::log()

### Parameters

#### $msg

`string`

The message to log

#### $level

`integer`

The priority of the message

## Main entry point, doesn't do anything

    main() : void

Inherited

This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running phing target1 target2 will run all tasks in target3 twice.

Should throw a BuildException if someting goes wrong with the build

This is abstract here. Must be overloaded by real tasks.

access | public
final |
inherited_from | \Service_Amazon_S3::main()

## Configure this task if it hasn't been done already.

    maybeConfigure()

Inherited

inherited_from | \Task::maybeConfigure()
inherited_from | \Service_Amazon::maybeConfigure()
inherited_from | \Service_Amazon_S3::maybeConfigure()

## Perfrom this task

    perform()

Inherited

inherited_from | \Task::perform()
inherited_from | \Service_Amazon::perform()
inherited_from | \Service_Amazon_S3::perform()

## setAcl()

    setAcl($permission)

### Parameters

#### $permission

## setBucket()

    setBucket($bucket)

Inherited

inherited_from | \Service_Amazon_S3::setBucket()

### Parameters

#### $bucket

## setContent()

    setContent($content)

### Parameters

#### $content

## setContentType()

    setContentType($contentType)

### Parameters

#### $contentType

## setCreateBuckets()

    setCreateBuckets($createBuckets)

### Parameters

#### $createBuckets

## Sets a textual description of the task

    setDescription(string $desc)

Inherited

inherited_from | \Task::setDescription()
inherited_from | \Service_Amazon::setDescription()
inherited_from | \Service_Amazon_S3::setDescription()

### Parameters

#### $desc

`string`

The text describing the task

## setKey()

    setKey($key)

Inherited

inherited_from | \Service_Amazon::setKey()
inherited_from | \Service_Amazon_S3::setKey()

### Parameters

#### $key

## Sets the location within the buildfile this task occurs.

    setLocation(\Location $location)

Inherited

Called by the parser to set location information.

inherited_from | \Task::setLocation()
inherited_from | \Service_Amazon::setLocation()
inherited_from | \Service_Amazon_S3::setLocation()

### Parameters

#### $location

`\Location`

The location object describing the position of this task within the buildfile.

## setObject()

    setObject($object)

### Parameters

#### $object

## Sets the owning target this task belongs to.

    setOwningTarget(\Target $target)

Inherited

inherited_from | \Task::setOwningTarget()
inherited_from | \Service_Amazon::setOwningTarget()
inherited_from | \Service_Amazon_S3::setOwningTarget()

### Parameters

#### $target

`\Target`

Reference to owning target

## References the project to the current component.

    setProject(\Project $project)

Inherited

inherited_from | \ProjectComponent::setProject()
inherited_from | \Task::setProject()
inherited_from | \Service_Amazon::setProject()
inherited_from | \Service_Amazon_S3::setProject()

### Parameters

#### $project

`\Project`

The reference to the current project

## Sets the wrapper object this task should use for runtime configurable elements.

    setRuntimeConfigurableWrapper(\RuntimeConfigurable $wrapper)

Inherited

inherited_from | \Task::setRuntimeConfigurableWrapper()
inherited_from | \Service_Amazon::setRuntimeConfigurableWrapper()
inherited_from | \Service_Amazon_S3::setRuntimeConfigurableWrapper()

### Parameters

#### $wrapper

`\RuntimeConfigurable`

The wrapper object this task should use

## setSecret()

    setSecret($secret)

Inherited

inherited_from | \Service_Amazon::setSecret()
inherited_from | \Service_Amazon_S3::setSecret()

### Parameters

#### $secret

## setSource()

    setSource($source)

### Parameters

#### $source

## Sets the name of this task for log messages

    setTaskName(string $name) : string

Inherited

inherited_from | \Task::setTaskName()
inherited_from | \Service_Amazon::setTaskName()
inherited_from | \Service_Amazon_S3::setTaskName()

### Parameters

#### $name

`string`

### Returns

`string`A string representing the name of this task for log

## Sets the type of the task.

    setTaskType(string $name)

Inherited

Usually this is the name of the XML tag

inherited_from | \Task::setTaskType()
inherited_from | \Service_Amazon::setTaskType()
inherited_from | \Service_Amazon_S3::setTaskType()

### Parameters

#### $name

`string`

The type of this task (XML Tag)

## Returns a name

    getRegisterSlot(string $slotName)

Inherited

inherited_from | \Task::getRegisterSlot()
inherited_from | \Service_Amazon::getRegisterSlot()
inherited_from | \Service_Amazon_S3::getRegisterSlot()

### Parameters

#### $slotName

`string`

## saveObject()

    saveObject($object, $data)

### Parameters

#### $object

#### $data

### Properties

##

    $_acl : string

(default value: 'private')

access | protected

##

    $_client : \Services_Amazon_S3

Inherited

(default value: null)

see | \global\Services_Amazon_S3
access | protected
inherited_from | \Service_Amazon_S3::$$_client

##

    $_content : mixed

The user can specify either a file to upload or just a bit of content

(default value: null)

access | protected

##

    $_contentType : string

(default value: 'binary/octet-stream')

access | protected

##

    $_createBuckets : bool

(default value: false)

access | protected

##

    $_extensionContentTypeMapper : array

access | protected

##

    $_filesets : array

(default value: array())

access | protected

##

    $_options : array

Inherited

We set these magically so we can also load then from the environment

(default value: array())

access | protected
inherited_from | \Service_Amazon::$$_options
inherited_from | \Service_Amazon_S3::$$_options

##

    $_source : string

(default value: null)

access | protected

##

    $description : string

Inherited

inherited_from | \Task::$$description
inherited_from | \Service_Amazon::$$description
inherited_from | \Service_Amazon_S3::$$description

##

    $location : \Location

Inherited

inherited_from | \Task::$$location
inherited_from | \Service_Amazon::$$location
inherited_from | \Service_Amazon_S3::$$location

##

    $project : \Project

Inherited

inherited_from | \ProjectComponent::$$project
inherited_from | \Task::$$project
inherited_from | \Service_Amazon::$$project
inherited_from | \Service_Amazon_S3::$$project

##

    $target : \Target

Inherited

inherited_from | \Task::$$target
inherited_from | \Service_Amazon::$$target
inherited_from | \Service_Amazon_S3::$$target

##

    $taskName : string

Inherited

inherited_from | \Task::$$taskName
inherited_from | \Service_Amazon::$$taskName
inherited_from | \Service_Amazon_S3::$$taskName

##

    $taskType : string

Inherited

inherited_from | \Task::$$taskType
inherited_from | \Service_Amazon::$$taskType
inherited_from | \Service_Amazon_S3::$$taskType

##

    $wrapper : \RuntimeConfigurable

Inherited

inherited_from | \Task::$$wrapper
inherited_from | \Service_Amazon::$$wrapper
inherited_from | \Service_Amazon_S3::$$wrapper