Class xPDOTransport

Description

Represents xPDOObject and related data in a serialized format for exchange.

Located in /transport/xpdotransport.class.php (line 34)


	
			
Class Constant Summary
 ABORT_INSTALL_ON_VEHICLE_FAIL = 'abort_install_on_vehicle_fail'
 ARCHIVE_WITH = 'archive_with'
 INSTALL_FILES = 'install_files'
 MANIFEST_ATTRIBUTES = 'manifest-attributes'
 MANIFEST_VEHICLES = 'manifest-vehicles'
 MANIFEST_VERSION = 'manifest-version'
 NATIVE_KEY = 'native_key'
 PACKAGE_ACTION = 'package_action'
 PACKAGE_STATE = 'package_state'
 PREEXISTING_MODE = 'preexisting_mode'
 PRESERVE_KEYS = 'preserve_keys'
 RELATED_OBJECTS = 'related_objects'
 RELATED_OBJECT_ATTRIBUTES = 'related_object_attributes'
 RESOLVE_FILES = 'resolve_files'
 RESOLVE_FILES_REMOVE = 'resolve_files_remove'
 RESOLVE_PHP = 'resolve_php'
 UNINSTALL_FILES = 'uninstall_files'
 UNINSTALL_OBJECT = 'uninstall_object'
 UNIQUE_KEY = 'unique_key'
 UPDATE_OBJECT = 'update_object'
Variable Summary
 array $attributes
 string $path
 string $signature
 integer $state
 array $vehicles
 array $_preserved
Method Summary
 static string manifestVersion (array $manifest)
 static void retrieve ( &$xpdo,  $source,  $target, [ $state = xPDOTransport::STATE_PACKED])
 static array unpack (xPDO &$xpdo, string $from, string $to, [integer $state = xPDOTransport::STATE_PACKED])
 static array _convertManifestVer1_0 (array $manifestVehicles)
 static array _convertManifestVer1_1 (array $vehicles)
 static boolean _pack (xPDO &$xpdo, string $filename, string $path, string $source)
 static array|boolean _unpack (xPDO &$xpdo, string $from, string $to)
 xPDOVehicle get (string $objFile, [array $options = array ()])
 mixed getAttribute (string $key)
 boolean install ([array $options = array ()])
 array loadPreserved ()
 boolean pack ()
 void put (mixed $artifact, [array $attributes = array ()])
 void registerVehicle (xPDOVehicle &$vehicle)
 void setAttribute (string $key, mixed $value)
 void store (mixed $location)
 boolean uninstall ([array $options = array ()])
 xPDOTransport __construct (xPDO &$xpdo, string $signature, string $path)
 boolean writeManifest ()
 boolean writePreserved ()
Variables
array $attributes = array () (line 109)

Stores various attributes about the transport package.

  • access: public
string $manifestVersion = '1.1' (line 124)

The current manifest version for this transport.

  • access: public
string $path = null (line 119)

The physical location of the transport package.

  • access: public
string $signature = null (line 99)

A unique signature to identify the package.

  • access: public
integer $state = null (line 104)

Indicates the state of the xPDOTransport instance.

  • access: public
array $vehicles = array () (line 114)

A map of object vehicles containing payloads of data for transport.

  • access: public
xPDO $xpdo = null (line 93)

An xPDO reference controlling this transport instance.

  • access: public
array $_preserved = array() (line 129)

An map of preserved objects from an install used by uninstall.

  • access: public
Methods
static manifestVersion (line 570)

Returns the structure version of the given manifest array.

  • return: Version string of the manifest structure.
  • access: public
static string manifestVersion (array $manifest)
  • array $manifest: A valid xPDOTransport manifest array.
static retrieve (line 454)

Get an existing xPDOTransport instance.

  • access: public
static void retrieve ( &$xpdo,  $source,  $target, [ $state = xPDOTransport::STATE_PACKED])
  • &$xpdo
  • $source
  • $target
  • $state
static unpack (line 517)

Unpack the package to prepare for installation and return a manifest.

  • return: The manifest which is included after successful extraction.
  • access: public
static array unpack (xPDO &$xpdo, string $from, string $to, [integer $state = xPDOTransport::STATE_PACKED])
  • xPDO &$xpdo: A reference to an xPDO instance.
  • string $from: Filename of the archive containing the transport package.
  • string $to: The root path where the contents of the archive should be extracted. This path must be writable by the user executing the PHP process on the server.
  • integer $state: The current state of the package, i.e. packed or unpacked.
static _convertManifestVer1_0 (line 595)

Converts older manifest vehicles to 1.0 format.

  • return: Vehicle definition structures converted to 1.0 format.
  • access: protected
static array _convertManifestVer1_0 (array $manifestVehicles)
  • array $manifestVehicles: A structure representing vehicles from a pre-1.0 manifest format.
static _convertManifestVer1_1 (line 621)

Converts 1.0 manifest vehicles to 1.1 format.

  • return: Vehicle definition structures converted to 1.1 format.
  • access: protected
static array _convertManifestVer1_1 (array $vehicles)
  • array $vehicles: A structure representing vehicles from a pre-1.1 manifest format.
static _pack (line 310)

Pack the resources from path relative to source into an archive with filename.

  • return: True if packed successfully.
  • todo: Refactor this to be implemented in a service class external to xPDOTransport.
  • access: public
  • uses: compression.xPDOZip - OR compression.PclZip
static boolean _pack (xPDO &$xpdo, string $filename, string $path, string $source)
  • xPDO &$xpdo: A reference to an xPDO instance.
  • string $filename: A valid zip archive filename.
  • string $path: An absolute file system path location of the resources to pack.
  • string $source: A relative portion of path to include in the archive.
static _unpack (line 546)

Unpack a zip archive to a specified location.

  • return: An array of unpacked resources or false on failure.
  • todo: Refactor this to be implemented in a service class external to xPDOTransport.
  • access: public
  • uses: compression.xPDOZip - OR compression.PclZip
static array|boolean _unpack (xPDO &$xpdo, string $from, string $to)
  • xPDO &$xpdo: A reference to an xPDO instance.
  • string $from: An absolute file system location to a valid zip archive.
  • string $to: A file system location to extract the contents of the archive to.
get (line 154)

Get an xPDOVehicle instance from an unpacked transport package.

  • return: The vehicle represented in the file.
  • access: public
xPDOVehicle get (string $objFile, [array $options = array ()])
  • string $objFile: Full path to a payload file to import. The payload file, when included must return a valid xPDOVehicle::$payload.
  • array $options: An array of options to be applied when getting the object.
getAttribute (line 435)

Get an attribute of the package manifest.

  • return: The value of the attribute or null if it is not set.
  • access: public
mixed getAttribute (string $key)
  • string $key: The key of the attribute to retrieve.
install (line 182)

Install vehicles in the package into the sponsor xPDO instance.

  • return: true if the vehicles were successfully installed.
  • access: public
boolean install ([array $options = array ()])
  • array $options: Install options to be applied to the process.
loadPreserved (line 406)

Load preserved objects from the previous install().

  • return: An array of preserved objects, or an empty array.
  • access: public
array loadPreserved ()
pack (line 283)

Pack the xPDOTransport instance in preparation for distribution.

  • return: Indicates if the transport was packed successfully.
  • access: public
boolean pack ()
put (line 257)

Wrap artifact with an xPDOVehicle and register in the transport.

  • access: public
void put (mixed $artifact, [array $attributes = array ()])
  • mixed $artifact: An artifact to load into the transport.
  • array $attributes: A set of attributes related to the artifact; these can be anything from rules describing how to pack or unpack the artifact, or any other data that might be useful when dealing with a transportable artifact.
registerVehicle (line 425)

Register an xPDOVehicle with this transport instance.

  • access: public
void registerVehicle (xPDOVehicle &$vehicle)
  • xPDOVehicle &$vehicle: A reference to the vehicle being registered.
setAttribute (line 447)

Set an attribute of the package manifest.

  • access: public
void setAttribute (string $key, mixed $value)
  • string $key: The key identifying the attribute to set.
  • mixed $value: The value to set the attribute to.
store (line 501)

Store the package to a specified resource location.

  • todo: Implement ability to store a package to a specified location, supporting various transport methods.
  • access: public
void store (mixed $location)
  • mixed $location: The location to store the package.
uninstall (line 220)

Uninstall vehicles in the package from the sponsor xPDO instance.

  • return: true if the vehicles were successfully uninstalled.
  • access: public
boolean uninstall ([array $options = array ()])
  • array $options: Uninstall options to be applied to the process.
Constructor __construct (line 138)

Prepares and returns a new xPDOTransport instance.

  • access: public
xPDOTransport __construct (xPDO &$xpdo, string $signature, string $path)
  • xPDO &$xpdo: The xPDO instance accessing this package.
  • string $signature: The unique signature of the package.
  • string $path: Valid path to the physical transport package.
writeManifest (line 353)

Write the package manifest file.

  • return: Indicates if the manifest was successfully written.
  • access: public
boolean writeManifest ()
writePreserved (line 385)

Write objects preserved during install() to file for use by uninstall().

  • return: Indicates if the preserved file was successfully written.
  • access: public
boolean writePreserved ()
Class Constants
ABORT_INSTALL_ON_VEHICLE_FAIL = 'abort_install_on_vehicle_fail' (line 58)

Attributes of the package that can be used to control behavior.

ACTION_INSTALL = 0 (line 77)

Indicates an action that can be performed on the package.

Attributes of the package that can be used to control behavior.

ACTION_UNINSTALL = 2 (line 79)

Attributes of the package that can be used to control behavior.

ACTION_UPGRADE = 1 (line 78)

Attributes of the package that can be used to control behavior.

ARCHIVE_WITH = 'archive_with' (line 57)

Attributes of the package that can be used to control behavior.

ARCHIVE_WITH_DEFAULT = 0 (line 85)

Indicates which archiving tool to use for pack()'ing and unpack()'ing the transport.

ARCHIVE_WITH_PCLZIP = 1 (line 86)
ARCHIVE_WITH_ZIPARCHIVE = 2 (line 87)
INSTALL_FILES = 'install_files' (line 54)

Attributes of the package that can be used to control behavior.

MANIFEST_ATTRIBUTES = 'manifest-attributes' (line 50)

Attributes of the package that can be used to control behavior.

MANIFEST_VEHICLES = 'manifest-vehicles' (line 51)

Attributes of the package that can be used to control behavior.

MANIFEST_VERSION = 'manifest-version' (line 52)

Attributes of the package that can be used to control behavior.

NATIVE_KEY = 'native_key' (line 40)

Attributes of the package that can be used to control behavior.

PACKAGE_ACTION = 'package_action' (line 46)

Attributes of the package that can be used to control behavior.

PACKAGE_STATE = 'package_state' (line 47)

Attributes of the package that can be used to control behavior.

PREEXISTING_MODE = 'preexisting_mode' (line 53)

Attributes of the package that can be used to control behavior.

PRESERVE_KEYS = 'preserve_keys' (line 39)

Attributes of the package that can be used to control behavior.

PRESERVE_PREEXISTING = 0 (line 63)

Indicates how pre-existing objects are treated on install/uninstall.

Attributes of the package that can be used to control behavior.

RELATED_OBJECTS = 'related_objects' (line 48)

Attributes of the package that can be used to control behavior.

RELATED_OBJECT_ATTRIBUTES = 'related_object_attributes' (line 49)

Attributes of the package that can be used to control behavior.

REMOVE_PREEXISTING = 1 (line 64)

Attributes of the package that can be used to control behavior.

RESOLVE_FILES = 'resolve_files' (line 43)

Attributes of the package that can be used to control behavior.

RESOLVE_FILES_REMOVE = 'resolve_files_remove' (line 44)

Attributes of the package that can be used to control behavior.

RESOLVE_PHP = 'resolve_php' (line 45)

Attributes of the package that can be used to control behavior.

RESTORE_PREEXISTING = 2 (line 65)

Attributes of the package that can be used to control behavior.

STATE_INSTALLED = 2 (line 72)

Attributes of the package that can be used to control behavior.

STATE_PACKED = 1 (line 71)

Attributes of the package that can be used to control behavior.

STATE_UNPACKED = 0 (line 70)

Indicates the physical state of the package.

Attributes of the package that can be used to control behavior.

UNINSTALL_FILES = 'uninstall_files' (line 55)

Attributes of the package that can be used to control behavior.

UNINSTALL_OBJECT = 'uninstall_object' (line 56)

Attributes of the package that can be used to control behavior.

UNIQUE_KEY = 'unique_key' (line 41)

Attributes of the package that can be used to control behavior.

UPDATE_OBJECT = 'update_object' (line 42)

Attributes of the package that can be used to control behavior.

Documentation generated on Mon, 27 Dec 2010 11:08:33 -0700 by phpDocumentor 1.4.3