tasks/ext/Service/Amazon/S3/S3PutTask.php

Show: inherited
Table of Contents

Stores an object on S3

Author
Andrei Serdeliuc  
Extends
Service_Amazon_S3  
Package
phing.tasks.ext  
Version
$Id: 84b1d6039427591cbf43dbe1a82691063ae4238a $  

\S3PutTask

Package: phing\tasks\ext

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: 84b1d6039427591cbf43dbe1a82691063ae4238a $  

Properties

Propertyprotected\Services_Amazon_S3  $_client= 'null'
inherited

Services_Amazon_S3 client

Inherited from: \Service_Amazon_S3::$$_client

(default value: null)

Default valuenullDetails
Type
\Services_Amazon_S3
Access
protected  
Inherited_from
\Service_Amazon_S3::$$_client  
See
\Services_Amazon_S3  
Propertyprotectedmixed  $_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)

Default valuenullDetails
Type
mixed
Access
protected  
Propertyprotectedbool  $_createBuckets= 'false'

Whether to try to create buckets or not

(default value: false)

Default valuefalseDetails
Type
bool
Access
protected  
Propertyprotectedarray  $_filesets= 'array()'

Collection of filesets Used for uploading multiple files

(default value: array())

Default valuearray()Details
Type
array
Access
protected  
Propertyprotectedarray  $_options= 'array()'
inherited

Collection of set options

Inherited from: \Service_Amazon::$$_options\Service_Amazon_S3::$$_options

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

(default value: array())

Default valuearray()Details
Type
array
Access
protected  
Inherited_from
\Service_Amazon::$$_options  
Inherited_from
\Service_Amazon_S3::$$_options  
Propertyprotectedstring  $_source= 'null'

File we're trying to upload

(default value: null)

Default valuenullDetails
Type
string
Access
protected  
Propertyprotectedstring  $description= ''
Details
Type
string
Inherited_from
\Task::$$description  
Inherited_from
\Service_Amazon::$$description  
Inherited_from
\Service_Amazon_S3::$$description  
Propertyprotected\Location  $location= ''
inherited

Stored buildfile location

Inherited from: \Task::$$location\Service_Amazon::$$location\Service_Amazon_S3::$$location
Details
Type
\Location
Inherited_from
\Task::$$location  
Inherited_from
\Service_Amazon::$$location  
Inherited_from
\Service_Amazon_S3::$$location  
Propertyprotected\Project  $project= 'null'
inherited

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::$$project\Service_Amazon_S3::$$project
Default valuenullDetails
Type
\Project
Inherited_from
\ProjectComponent::$$project  
Inherited_from
\Task::$$project  
Inherited_from
\Service_Amazon::$$project  
Inherited_from
\Service_Amazon_S3::$$project  
Propertyprotected\Target  $target= ''
inherited

Owning Target object

Inherited from: \Task::$$target\Service_Amazon::$$target\Service_Amazon_S3::$$target
Details
Type
\Target
Inherited_from
\Task::$$target  
Inherited_from
\Service_Amazon::$$target  
Inherited_from
\Service_Amazon_S3::$$target  
Propertyprotectedstring  $taskName= ''
Details
Type
string
Inherited_from
\Task::$$taskName  
Inherited_from
\Service_Amazon::$$taskName  
Inherited_from
\Service_Amazon_S3::$$taskName  
Propertyprotectedstring  $taskType= ''
inherited

Internal taskname (req)

Inherited from: \Task::$$taskType\Service_Amazon::$$taskType\Service_Amazon_S3::$$taskType
Details
Type
string
Inherited_from
\Task::$$taskType  
Inherited_from
\Service_Amazon::$$taskType  
Inherited_from
\Service_Amazon_S3::$$taskType  
Propertyprotected\RuntimeConfigurable  $wrapper= ''
Details
Type
\RuntimeConfigurable
Inherited_from
\Task::$$wrapper  
Inherited_from
\Service_Amazon::$$wrapper  
Inherited_from
\Service_Amazon_S3::$$wrapper  

Methods

methodpublic__get( mixed $var ) : void
inherited

Property getter

Inherited from: \Service_Amazon::__get()\Service_Amazon_S3::__get()

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

Parameters
Name Type Description
$var mixed
Details
Access
public  
methodpublic__isset(  $var ) : void
Parameters
Name Type Description
$var
methodpublic__set(  $var,  $val ) : void
Parameters
Name Type Description
$var
$val
methodpubliccreateBucket( ) : void
inherited

Create a bucket

Inherited from: \Service_Amazon_S3::createBucket()
Details
Access
public  
methodpubliccreateFileset( ) : \FileSet

creator for _filesets

Returns
Type Description
\FileSet
Details
Access
public  
methodpublicexecute( ) : void

Store the object on S3

Details
Access
public  
methodpublicgetBucket( ) : void
inherited

Inherited from: \Service_Amazon_S3::getBucket()
methodpublicgetBucketInstance( ) : \Services_Amazon_S3_Resource_Bucket
inherited

Returns an instance of Services_Amazon_S3_Resource_Bucket

Inherited from: \Service_Amazon_S3::getBucketInstance()
Returns
Type Description
\Services_Amazon_S3_Resource_Bucket
Details
Access
public  
methodpublicgetClient( ) : \Services_Amazon_S3
inherited

We only instantiate the client once per task call

Inherited from: \Service_Amazon_S3::getClient()
Returns
Type Description
\Services_Amazon_S3
Details
Access
public  
methodpublicgetContent( ) : void

methodpublicgetCreateBuckets( ) : void

methodpublicgetDescription( ) : string
inherited

Returns the textual description of the task

Inherited from: \Task::getDescription()\Service_Amazon::getDescription()\Service_Amazon_S3::getDescription()
Returns
Type Description
string The text description of the task
methodpublicgetFilesets( ) : array

getter for _filesets

Returns
Type Description
array
Details
Access
public  
methodpublicgetKey( ) : void
methodpublicgetLocation( ) : \Location
inherited

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()\Service_Amazon_S3::getLocation()
Returns
Type Description
\Location The location object describing the position of this task within the buildfile.
methodpublicgetObject( ) : void

methodpublicgetObjectContents( string $object ) : mixed
inherited

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

Inherited from: \Service_Amazon_S3::getObjectContents()
Parameters
Name Type Description
$object string
Returns
Type Description
mixed
Details
Access
public  
methodpublicgetObjectData( ) : string

Determines what we're going to store in the object

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

Returns
Type Description
string
Details
Access
public  
methodpublicgetObjectInstance( mixed $object ) : \Services_Amazon_S3_Resource_Object
inherited

Returns an instance of Services_Amazon_S3_Resource_Object

Inherited from: \Service_Amazon_S3::getObjectInstance()
Parameters
Name Type Description
$object mixed
Returns
Type Description
\Services_Amazon_S3_Resource_Object
Details
Access
public  
methodpublicgetOwningTarget( ) : \Target
inherited

Returns the owning target of this task.

Inherited from: \Task::getOwningTarget()\Service_Amazon::getOwningTarget()\Service_Amazon_S3::getOwningTarget()
Returns
Type Description
\Target The target object that owns this task
methodpublicgetProject( ) : \Project
Returns
Type Description
\Project Reference to current porject object
methodprotectedgetRegisterSlot( string $slotName ) : void
Parameters
Name Type Description
$slotName string
methodpublicgetRuntimeConfigurableWrapper( ) : \RuntimeConfigurable
Returns
Type Description
\RuntimeConfigurable The wrapper object used by this task
methodpublicgetSecret( ) : void
methodpublicgetSource( ) : void

methodpublicgetTaskName( ) : string
inherited

Returns the name of task, used only for log messages

Inherited from: \Task::getTaskName()\Service_Amazon::getTaskName()\Service_Amazon_S3::getTaskName()
Returns
Type Description
string Name of this task
methodpublicgetTaskType( ) : string
inherited

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

Inherited from: \Task::getTaskType()\Service_Amazon::getTaskType()\Service_Amazon_S3::getTaskType()
Returns
Type Description
string The type of this task (XML Tag)
methodpublicinit( ) : void
inherited

Called by the parser to let the task initialize properly.

Inherited from: \Task::init()\Service_Amazon::init()\Service_Amazon_S3::init()

Should throw a BuildException if something goes wrong with the build

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

Throws
Exception Description
\BuildException
methodpublicisBucketAvailable( ) : bool
inherited

Check if the current bucket is available

Inherited from: \Service_Amazon_S3::isBucketAvailable()
Returns
Type Description
bool
Details
Access
public  
methodpublicisObjectAvailable( mixed $object ) : bool
inherited

Check if the object already exists in the current bucket

Inherited from: \Service_Amazon_S3::isObjectAvailable()
Parameters
Name Type Description
$object mixed
Returns
Type Description
bool
Details
Access
public  
methodpubliclog( string $msg, integer $level = Project::MSG_INFO ) : void
inherited

Provides a project level log event to the task.

Inherited from: \Task::log()\Service_Amazon::log()\Service_Amazon_S3::log()
Parameters
Name Type Description
$msg string

The message to log

$level integer

The priority of the message

Details
See
\BuildEvent  
See
\BuildListener  
methodpublicmain( ) : void
finalinherited

Main entry point, doesn't do anything

Inherited from: \Service_Amazon_S3::main()

Should throw a BuildException if someting goes wrong with the build

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

Details
Access
public  
Final
 
methodpublicmaybeConfigure( ) : void
inherited

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

Inherited from: \Task::maybeConfigure()\Service_Amazon::maybeConfigure()\Service_Amazon_S3::maybeConfigure()
methodpublicperform( ) : void
methodprotectedsaveObject(  $object,  $data ) : void

Parameters
Name Type Description
$object
$data
methodpublicsetBucket(  $bucket ) : void
inherited

Inherited from: \Service_Amazon_S3::setBucket()
Parameters
Name Type Description
$bucket
methodpublicsetContent(  $content ) : void

Parameters
Name Type Description
$content
methodpublicsetCreateBuckets(  $createBuckets ) : void

Parameters
Name Type Description
$createBuckets
methodpublicsetDescription( string $desc ) : void
inherited

Sets a textual description of the task

Inherited from: \Task::setDescription()\Service_Amazon::setDescription()\Service_Amazon_S3::setDescription()
Parameters
Name Type Description
$desc string

The text describing the task

methodpublicsetKey(  $key ) : void
Parameters
Name Type Description
$key
methodpublicsetLocation( \Location $location ) : void
inherited

Sets the location within the buildfile this task occurs. Called by the parser to set location information.

Inherited from: \Task::setLocation()\Service_Amazon::setLocation()\Service_Amazon_S3::setLocation()
Parameters
Name Type Description
$location \Location

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

methodpublicsetObject(  $object ) : void

Parameters
Name Type Description
$object
methodpublicsetOwningTarget( \Target $target ) : void
inherited

Sets the owning target this task belongs to.

Inherited from: \Task::setOwningTarget()\Service_Amazon::setOwningTarget()\Service_Amazon_S3::setOwningTarget()
Parameters
Name Type Description
$target \Target

Reference to owning target

methodpublicsetProject( \Project $project ) : void
inherited

References the project to the current component.

Inherited from: \ProjectComponent::setProject()\Task::setProject()\Service_Amazon::setProject()\Service_Amazon_S3::setProject()
Parameters
Name Type Description
$project \Project

The reference to the current project

methodpublicsetRuntimeConfigurableWrapper( \RuntimeConfigurable $wrapper ) : void
inherited

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

Inherited from: \Task::setRuntimeConfigurableWrapper()\Service_Amazon::setRuntimeConfigurableWrapper()\Service_Amazon_S3::setRuntimeConfigurableWrapper()
Parameters
Name Type Description
$wrapper \RuntimeConfigurable

The wrapper object this task should use

methodpublicsetSecret(  $secret ) : void
Parameters
Name Type Description
$secret
methodpublicsetSource(  $source ) : void

Parameters
Name Type Description
$source
methodpublicsetTaskName( string $name ) : string
inherited

Sets the name of this task for log messages

Inherited from: \Task::setTaskName()\Service_Amazon::setTaskName()\Service_Amazon_S3::setTaskName()
Parameters
Name Type Description
$name string
Returns
Type Description
string A string representing the name of this task for log
methodpublicsetTaskType( string $name ) : void
inherited

Sets the type of the task. Usually this is the name of the XML tag

Inherited from: \Task::setTaskType()\Service_Amazon::setTaskType()\Service_Amazon_S3::setTaskType()
Parameters
Name Type Description
$name string

The type of this task (XML Tag)

Documentation was generated by DocBlox 0.18.1.