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

## \Service_Amazon_S3
jump to top

Package: phing\tasks\ext

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)

Default value `null` Details

Type
  \Services_Amazon_S3
Access
  protected
See
  \Services_Amazon_S3

`array $_options= 'array()'`
inherited

Collection of set options

Inherited from: \Service_Amazon::$_options

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

(default value: array())

Default value `array()`Details

Type
  array
Access
  protected
Inherited_from
  \Service_Amazon::$_options

`string $description= ''`
inherited

description of the taskInherited from: \Task::$description
Details

Type
  string
Inherited_from
  \Task::$description

`\Location $location= ''`
inherited

stored buildfile locationInherited from: \Task::$location
Details

Type
  \Location
Inherited_from
  \Task::$location

`\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
Default value `null` Details

Type
  \Project
Inherited_from
  \ProjectComponent::$project

`\Target $target= ''`
inherited

owning Target objectInherited from: \Task::$target
Details

Type
  \Target
Inherited_from
  \Task::$target

`string $taskName= ''`
inherited

Taskname for loggerInherited from: \Task::$taskName
Details

Type
  string
Inherited_from
  \Task::$taskName

`string $taskType= ''`
inherited

internal taskname (req)Inherited from: \Task::$taskType
Details

Type
  string
Inherited_from
  \Task::$taskType

`\RuntimeConfigurable $wrapper= ''`
inherited

wrapper of the taskInherited from: \Task::$wrapper
Details

Type
  \RuntimeConfigurable
Inherited_from
  \Task::$wrapper

### Methods

`__get( mixed $var ) : void`
inherited

Property getter

Inherited from: \Service_Amazon::__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

`__isset( $var ) : void`
inherited

Inherited from: \Service_Amazon::__isset()
Parameters

Name | Type | Description
--- | --- | ---
$var |  |

`__set( $var, $val ) : void`
inherited

Inherited from: \Service_Amazon::__set()
Parameters

Name | Type | Description
--- | --- | ---
$var |  |
$val |  |

`createBucket( ) : void`

Create a bucket

Details

Access
  public

`execute( ) : void`
abstract

Entry point to children tasks

Details

Abstract
Access
  public

`getBucket( ) : void`

`getBucketInstance( ) : \Services_Amazon_S3_Resource_Bucket`

Returns an instance of Services_Amazon_S3_Resource_Bucket

Returns

Type | Description
--- | ---
\Services_Amazon_S3_Resource_Bucket |

Details

Access
  public

`getClient( ) : \Services_Amazon_S3`

We only instantiate the client once per task call

Returns

Type | Description
--- | ---
\Services_Amazon_S3 |

Details

Access
  public

`getDescription( ) : string`
inherited

Returns the textual description of the task

Inherited from: \Task::getDescription()
Returns

Type | Description
--- | ---
string | The text description of the task

`getKey( ) : void`
inherited

Inherited from: \Service_Amazon::getKey()
`getLocation( ) : \Location`
inherited

Returns the location within the buildfile this task occurs. Used by {@link BuildException} to give detailed error messages.

Inherited from: \Task::getLocation()
Returns

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)

Parameters

Name | Type | Description
--- | --- | ---
$object | string |

Returns

Type | Description
--- | ---
mixed |

Details

Access
  public

`getObjectInstance( mixed $object ) : \Services_Amazon_S3_Resource_Object`

Returns an instance of Services_Amazon_S3_Resource_Object

Parameters

Name | Type | Description
--- | --- | ---
$object | mixed |

Returns

Type | Description
--- | ---
\Services_Amazon_S3_Resource_Object |

Details

Access
  public

`getOwningTarget( ) : \Target`
inherited

Returns the owning target of this task.

Inherited from: \Task::getOwningTarget()
Returns

Type | Description
--- | ---
\Target | The target object that owns this task

`getProject( ) : \Project`
inherited

Returns a reference to current project

Inherited from: \ProjectComponent::getProject()
Returns

Type | Description
--- | ---
\Project | Reference to current porject object

`getRegisterSlot( $slotName ) : void`
inherited

Returns a name

Inherited from: \Task::getRegisterSlot()
Parameters

Name | Type | Description
--- | --- | ---
$slotName |  |

`getRuntimeConfigurableWrapper( ) : \RuntimeConfigurable`
inherited

Returns the wrapper object for runtime configuration

Inherited from: \Task::getRuntimeConfigurableWrapper()
Returns

Type | Description
--- | ---
\RuntimeConfigurable | The wrapper object used by this task

`getSecret( ) : void`
inherited

Inherited from: \Service_Amazon::getSecret()
`getTaskName( ) : string`
inherited

Returns the name of task, used only for log messages

Inherited from: \Task::getTaskName()
Returns

Type | Description
--- | ---
string | Name of this task

`getTaskType( ) : string`
inherited

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

Inherited from: \Task::getTaskType()
Returns

Type | Description
--- | ---
string | The type of this task (XML Tag)

`init( ) : void`
inherited

Called by the parser to let the task initialize properly.

Inherited from: \Task::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 |

`isBucketAvailable( ) : bool`

Check if the current bucket is available

Returns

Type | Description
--- | ---
bool |

Details

Access
  public

`isObjectAvailable( mixed $object ) : bool`

Check if the object already exists in the current bucket

Parameters

Name | Type | Description
--- | --- | ---
$object | mixed |

Returns

Type | Description
--- | ---
bool |

Details

Access
  public

`log( string $msg, integer $level = Project::MSG_INFO ) : void`
inherited

Provides a project level log event to the task.

Inherited from: \Task::log()

@param string $msg The message to be logged.

Parameters

Name | Type | Description
--- | --- | ---
$msg | string | The message to log
$level | integer | The priority of the message

Details

See
  \BuildEvent
See
  \BuildListener

`main( ) : void`
final

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.

Details

Access
  public
Final

`maybeConfigure( ) : void`
inherited

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

Inherited from: \Task::maybeConfigure()
`perform( ) : void`
inherited

Perfrom this task

Inherited from: \Task::perform()
`setBucket( $bucket ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$bucket |  |

`setDescription( string $desc ) : void`
inherited

Sets a textual description of the task

Inherited from: \Task::setDescription()
Parameters

Name | Type | Description
--- | --- | ---
$desc | string | The text describing the task

`setKey( $key ) : void`
inherited

Inherited from: \Service_Amazon::setKey()
Parameters

Name | Type | Description
--- | --- | ---
$key |  |

`setLocation( \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()
Parameters

Name | Type | Description
--- | --- | ---
$location | \Location | The location object describing the position of this task within the buildfile.

`setOwningTarget( \Target $target ) : void`
inherited

Sets the owning target this task belongs to.

Inherited from: \Task::setOwningTarget()
Parameters

Name | Type | Description
--- | --- | ---
$target | \Target | Reference to owning target

`setProject( \Project $project ) : void`
inherited

References the project to the current component.

Inherited from: \ProjectComponent::setProject()
Parameters

Name | Type | Description
--- | --- | ---
$project | \Project | The reference to the current project

`setRuntimeConfigurableWrapper( \RuntimeConfigurable $wrapper ) : void`
inherited

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

Inherited from: \Task::setRuntimeConfigurableWrapper()
Parameters

Name | Type | Description
--- | --- | ---
$wrapper | \RuntimeConfigurable | The wrapper object this task should use

`setSecret( $secret ) : void`
inherited

Inherited from: \Service_Amazon::setSecret()
Parameters

Name | Type | Description
--- | --- | ---
$secret |  |

`setTaskName( $name ) : string`
inherited

Sets the name of this task for log messages

Inherited from: \Task::setTaskName()
Parameters

Name | Type | Description
--- | --- | ---
$name |  |

Returns

Type | Description
--- | ---
string | A string representing the name of this task for log

`setTaskType( string $name ) : void`
inherited

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

Inherited from: \Task::setTaskType()
Parameters

Name | Type | Description
--- | --- | ---
$name | string | The type of this task (XML Tag)

Documentation was generated by DocBlox 0.15.1.