# tasks/ext/pdo/PDOTask.php

## \PDOTask
jump to top

Package: phing\tasks\system

Handles PDO configuration needed by SQL type tasks.

Parent(s)
  \Task < \ProjectComponent
Children
  \PDOSQLExecTask
Author
  Hans Lellelid (Phing)
Author
  Nick Chalko (Ant)
Author
  Jeff Martin (Ant)
Author
  Michael McCallum (Ant)
Author
  Tim Stephenson (Ant)
Version
  $Revision: 1208 $

### Properties

`$autocommit= 'false'`

Autocommit flag. Default value is false

Default value `false` Details

Type
  n/a

`$caching= 'true'`
Default value `true` Details

Type
  n/a

`$password= ''`

Password

Details

Type
  n/a

`$rdbms= ''`

RDBMS Product needed for this SQL.

Details

Type
  n/a

`$url= ''`

DB url.

Details

Type
  n/a

`$userId= ''`

User name.

Details

Type
  n/a

### Methods

`getConnection( ) : \Connection`

Creates a new Connection as using the driver, url, userid and password specified.

The calling method is responsible for closing the connection.

Returns

Type | Description
--- | ---
\Connection | the newly created connection.

Throws

Exception | Description
--- | ---
\BuildException | if the UserId/Password/Url is not set or there is no suitable driver or the driver fails to load.

`getDescription( ) : void`

`getLoaderMap( ) : void`

`getLocation( ) : void`

`getOwningTarget( ) : void`

`getPassword( ) : \Returns`

Gets the password.

Returns

Type | Description
--- | ---
\Returns | a String

`getProject( ) : void`

`getRegisterSlot( ) : void`

`getRuntimeConfigurableWrapper( ) : void`

`getTaskName( ) : void`

`getTaskType( ) : void`

`getUrl( ) : \Returns`

Gets the url.

Returns

Type | Description
--- | ---
\Returns | a String

`getUserId( ) : \Returns`

Gets the userId.

Returns

Type | Description
--- | ---
\Returns | a String

`init( ) : void`

Initialize CreoleTask.

This method includes any necessary Creole libraries and triggers appropriate error if they cannot be found. This is not done in header because we may want this class to be loaded w/o triggering an error.

`isAutocommit( ) : \Returns`

Gets the autocommit.

Returns

Type | Description
--- | ---
\Returns | a boolean

`isCaching( $value ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$value |  |

`log( ) : void`

`main( ) : void`
abstract

`maybeConfigure( ) : void`

`perform( ) : void`

`setAutocommit( \autocommit $autocommit ) : void`

Auto commit flag for database connection; optional, default false.

Parameters

Name | Type | Description
--- | --- | ---
$autocommit | \autocommit | The autocommit to set

`setCaching( $enable ) : void`

Caching loaders / driver. This is to avoid getting an OutOfMemoryError when calling this task multiple times in a row; default: true

Parameters

Name | Type | Description
--- | --- | ---
$enable |  |

`setDescription( ) : void`

`setLocation( ) : void`

`setOwningTarget( ) : void`

`setPassword( \password $password ) : void`

Sets the password; required.

Parameters

Name | Type | Description
--- | --- | ---
$password | \password | The password to set

`setProject( ) : void`

`setRuntimeConfigurableWrapper( ) : void`

`setTaskName( ) : void`

`setTaskType( ) : void`

`setUrl( \url $url ) : void`

Sets the database connection URL; required.

Parameters

Name | Type | Description
--- | --- | ---
$url | \url | The url to set

`setUserid( \userId $userId ) : void`

Set the user name for the connection; required.

Parameters

Name | Type | Description
--- | --- | ---
$userId | \userId | The userId to set

`setVersion( \version $version ) : void`

Sets the version string, execute task only if rdbms version match; optional.

Parameters

Name | Type | Description
--- | --- | ---
$version | \version | The version to set

Documentation was generated by DocBlox 0.17.1.