tasks/ext/Service/Amazon/S3/S3PutTask.php
\S3PutTask
Stores an object on S3
Provides common methods and properties to all of the S3 tasks
- Parent(s)
- \Service_Amazon_S3 < \Service_Amazon < \Task < \ProjectComponent
- Author
- Andrei Serdeliuc
- Copyright
- 2001,2002 THYRELL. All rights reserved
- Extends
- Service_Amazon_S3
- Version
- $Id: S3PutTask.php 1184 2011-06-22 13:36:56Z mrook $
Properties

\Services_Amazon_S3
$_client= 'null'
(default value: null)
nullDetails- Type
- \Services_Amazon_S3
- Access
- protected
- Inherited_from
- \Service_Amazon_S3::$_client
- See
- \Services_Amazon_S3

mixed
$_content= 'null'
Content we're trying to upload
The user can specify either a file to upload or just a bit of content
(default value: null)
nullDetails- Type
- mixed
- Access
- protected

bool
$_createBuckets= 'false'
Whether to try to create buckets or not
(default value: false)
falseDetails- Type
- bool
- Access
- protected

array
$_filesets= 'array()'
Collection of filesets Used for uploading multiple files
(default value: array())
array()Details- Type
- array
- Access
- protected

array
$_options= 'array()'
We set these magically so we can also load then from the environment
(default value: array())
array()Details- Type
- array
- Access
- protected
- Inherited_from
- \Service_Amazon::$_options

string
$_source= 'null'
File we're trying to upload
(default value: null)
nullDetails- Type
- string
- Access
- protected

string
$description= ''
- Type
- string
- Inherited_from
- \Task::$description

\Location
$location= ''
- Type
- \Location
- Inherited_from
- \Task::$location

\Project
$project= 'null'
Holds a reference to the project that a project component (a task, a target, etc.) belongs to
A reference to the current project instanceInherited from: \ProjectComponent::$project
\Target
$target= ''
- Type
- \Target
- Inherited_from
- \Task::$target

string
$taskName= ''
- Type
- string
- Inherited_from
- \Task::$taskName

string
$taskType= ''
- Type
- string
- Inherited_from
- \Task::$taskType

\RuntimeConfigurable
$wrapper= ''
- Type
- \RuntimeConfigurable
- Inherited_from
- \Task::$wrapper
Methods

__get(
mixed $var
)
:
void
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
| Name | Type | Description |
|---|---|---|
| $var | mixed |
- Access
- public

__isset(
$var
)
:
void| Name | Type | Description |
|---|---|---|
| $var |

__set(
$var, $val
)
:
void| Name | Type | Description |
|---|---|---|
| $var | ||
| $val |

getBucketInstance(
)
:
\Services_Amazon_S3_Resource_BucketReturns an instance of Services_Amazon_S3_Resource_Bucket
Inherited from: \Service_Amazon_S3::getBucketInstance()| Type | Description |
|---|---|
| \Services_Amazon_S3_Resource_Bucket |
- Access
- public

getClient(
)
:
\Services_Amazon_S3We only instantiate the client once per task call
Inherited from: \Service_Amazon_S3::getClient()| Type | Description |
|---|---|
| \Services_Amazon_S3 |
- Access
- public

getLocation(
)
:
\LocationReturns the location within the buildfile this task occurs. Used by {@link BuildException} to give detailed error messages.
Inherited from: \Task::getLocation()| Type | Description |
|---|---|
| \Location | The location object describing the position of this task within the buildfile. |

getObjectContents(
string $object
)
:
mixedGet the contents of an object (by it's name)
Inherited from: \Service_Amazon_S3::getObjectContents()| Name | Type | Description |
|---|---|---|
| $object | string |
| Type | Description |
|---|---|
| mixed |
- Access
- public

getObjectData(
)
:
stringDetermines what we're going to store in the object
If _content has been set, this will get stored, otherwise, we read from _source
| Type | Description |
|---|---|
| string |
- Access
- public

getObjectInstance(
mixed $object
)
:
\Services_Amazon_S3_Resource_ObjectReturns an instance of Services_Amazon_S3_Resource_Object
Inherited from: \Service_Amazon_S3::getObjectInstance()| Name | Type | Description |
|---|---|---|
| $object | mixed |
| Type | Description |
|---|---|
| \Services_Amazon_S3_Resource_Object |
- Access
- public

getRuntimeConfigurableWrapper(
)
:
\RuntimeConfigurableReturns the wrapper object for runtime configuration
Inherited from: \Task::getRuntimeConfigurableWrapper()| Type | Description |
|---|---|
| \RuntimeConfigurable | The wrapper object used by this task |

getTaskType(
)
:
stringReturns the name of the task under which it was invoked, usually the XML tagname
Inherited from: \Task::getTaskType()| Type | Description |
|---|---|
| string | The type of this task (XML Tag) |

init(
)
:
void
Should throw a BuildException if something goes wrong with the build
This is abstract here, but may not be overloaded by subclasses.
| Exception | Description |
|---|---|
| \BuildException |

isBucketAvailable(
)
:
boolCheck if the current bucket is available
Inherited from: \Service_Amazon_S3::isBucketAvailable()| Type | Description |
|---|---|
| bool |
- Access
- public

isObjectAvailable(
mixed $object
)
:
boolCheck if the object already exists in the current bucket
Inherited from: \Service_Amazon_S3::isObjectAvailable()| Name | Type | Description |
|---|---|---|
| $object | mixed |
| Type | Description |
|---|---|
| bool |
- Access
- public

log(
string $msg, integer $level
=
Project::MSG_INFO
)
:
void
@param string $msg The message to be logged.
| Name | Type | Description |
|---|---|---|
| $msg | string | The message to log |
| $level | integer | The priority of the message |
- See
- \BuildEvent
- See
- \BuildListener

main(
)
:
void
Should throw a BuildException if someting goes wrong with the build
This is abstract here. Must be overloaded by real tasks.
- Access
- public
- Final

maybeConfigure(
)
:
voidConfigure this task if it hasn't been done already.
Inherited from: \Task::maybeConfigure()
setBucket(
$bucket
)
:
void| Name | Type | Description |
|---|---|---|
| $bucket |

setDescription(
string $desc
)
:
void
| Name | Type | Description |
|---|---|---|
| $desc | string | The text describing the task |

setKey(
$key
)
:
void| Name | Type | Description |
|---|---|---|
| $key |

setLocation(
\Location $location
)
:
voidSets the location within the buildfile this task occurs. Called by the parser to set location information.
Inherited from: \Task::setLocation()| Name | Type | Description |
|---|---|---|
| $location | \Location | The location object describing the position of this task within the buildfile. |

setOwningTarget(
\Target $target
)
:
void
| Name | Type | Description |
|---|---|---|
| $target | \Target | Reference to owning target |

setProject(
\Project $project
)
:
voidReferences the project to the current component.
Inherited from: \ProjectComponent::setProject()| Name | Type | Description |
|---|---|---|
| $project | \Project | The reference to the current project |

setRuntimeConfigurableWrapper(
\RuntimeConfigurable $wrapper
)
:
voidSets the wrapper object this task should use for runtime configurable elements.
Inherited from: \Task::setRuntimeConfigurableWrapper()| Name | Type | Description |
|---|---|---|
| $wrapper | \RuntimeConfigurable | The wrapper object this task should use |

setSecret(
$secret
)
:
void| Name | Type | Description |
|---|---|---|
| $secret |

setTaskName(
$name
)
:
string
| Name | Type | Description |
|---|---|---|
| $name |
| Type | Description |
|---|---|
| string | A string representing the name of this task for log |

setTaskType(
string $name
)
:
voidSets the type of the task. Usually this is the name of the XML tag
Inherited from: \Task::setTaskType()| Name | Type | Description |
|---|---|---|
| $name | string | The type of this task (XML Tag) |