tasks/ext/Service/Amazon/S3.php
Abstract Service_Amazon_S3 class.
Provides common methods and properties to all of the S3 tasks
- Abstract
- Author
- Andrei Serdeliuc
- Extends
- Service_Amazon
- Package
- phing.tasks.ext
- Version
- $ID$
\Service_Amazon_S3
Abstract Service_Amazon_S3 class.
Provides common methods and properties to all of the S3 tasks
- Parent(s)
- \Service_Amazon < \Task < \ProjectComponent
- Children
- \S3PutTask
- \S3GetTask
- Abstract
- Author
- Andrei Serdeliuc
- Copyright
- 2001,2002 THYRELL. All rights reserved
- Extends
- Service_Amazon
- Version
- $ID$
Properties


\Services_Amazon_S3
$_client= 'null'
Services_Amazon_S3 client
(default value: null)
null
Details- Type
- \Services_Amazon_S3
- Access
- protected
- See
- \Services_Amazon_S3


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
$description= ''
- Type
- string
- Inherited_from
- \Task::$$description
- Inherited_from
- \Service_Amazon::$$description


\Location
$location= ''
- Type
- \Location
- Inherited_from
- \Task::$$location
- Inherited_from
- \Service_Amazon::$$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\Task::$$project\Service_Amazon::$$projectnull
Details- Type
- \Project
- Inherited_from
- \ProjectComponent::$$project
- Inherited_from
- \Task::$$project
- Inherited_from
- \Service_Amazon::$$project


\Target
$target= ''
- Type
- \Target
- Inherited_from
- \Task::$$target
- Inherited_from
- \Service_Amazon::$$target


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


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


\RuntimeConfigurable
$wrapper= ''
- Type
- \RuntimeConfigurable
- Inherited_from
- \Task::$$wrapper
- Inherited_from
- \Service_Amazon::$$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_Bucket
Returns an instance of Services_Amazon_S3_Resource_Bucket
Type | Description |
---|---|
\Services_Amazon_S3_Resource_Bucket |
- Access
- public


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


getDescription(
)
:
string
Returns the textual description of the task
Inherited from: \Task::getDescription()\Service_Amazon::getDescription()Type | Description |
---|---|
string | The text description of the task |


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


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


getObjectInstance(
mixed $object
)
:
\Services_Amazon_S3_Resource_Object
Returns an instance of Services_Amazon_S3_Resource_Object
Name | Type | Description |
---|---|---|
$object | mixed |
Type | Description |
---|---|
\Services_Amazon_S3_Resource_Object |
- Access
- public


getOwningTarget(
)
:
\Target
Returns the owning target of this task.
Inherited from: \Task::getOwningTarget()\Service_Amazon::getOwningTarget()Type | Description |
---|---|
\Target | The target object that owns this task |


getProject(
)
:
\Project
Returns a reference to current project
Inherited from: \ProjectComponent::getProject()\Task::getProject()\Service_Amazon::getProject()Type | Description |
---|---|
\Project | Reference to current porject object |


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


getTaskName(
)
:
string
Returns the name of task, used only for log messages
Inherited from: \Task::getTaskName()\Service_Amazon::getTaskName()Type | Description |
---|---|
string | Name of this task |


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


init(
)
:
void
Called by the parser to let the task initialize properly.
Inherited from: \Task::init()\Service_Amazon::init()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(
)
:
bool
Check if the current bucket is available
Type | Description |
---|---|
bool |
- Access
- public


isObjectAvailable(
mixed $object
)
:
bool
Check if the object already exists in the current bucket
Name | Type | Description |
---|---|---|
$object | mixed |
Type | Description |
---|---|
bool |
- Access
- public


log(
string $msg, integer $level
=
Project::MSG_INFO
)
:
void
Provides a project level log event to the task.
Inherited from: \Task::log()\Service_Amazon::log()Name | Type | Description |
---|---|---|
$msg | string | The message to log |
$level | integer | The priority of the message |
- See
- \BuildEvent
- See
- \BuildListener


main(
)
:
void
Main entry point, doesn't do anything
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(
)
:
void
Configure this task if it hasn't been done already.
Inherited from: \Task::maybeConfigure()\Service_Amazon::maybeConfigure()

setDescription(
string $desc
)
:
void
Sets a textual description of the task
Inherited from: \Task::setDescription()\Service_Amazon::setDescription()Name | Type | Description |
---|---|---|
$desc | string | The text describing the task |


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


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


setOwningTarget(
\Target $target
)
:
void
Sets the owning target this task belongs to.
Inherited from: \Task::setOwningTarget()\Service_Amazon::setOwningTarget()Name | Type | Description |
---|---|---|
$target | \Target | Reference to owning target |


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


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


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


setTaskName(
string $name
)
:
string
Sets the name of this task for log messages
Inherited from: \Task::setTaskName()\Service_Amazon::setTaskName()Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
string | A string representing the name of this task for log |


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