tasks/ext/ManifestTask.php

Show: inherited
Table of Contents

$Id: ManifestTask.php 552 2009-08-29 12:18:13Z mrook $

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This software consists of voluntary contributions made by many individuals and is licensed under the LGPL. For more information please see http://phing.info.

\ManifestTask

Package: phing\tasks\ext

ManifestTask

Generates a simple Manifest file with optional checksums.

Manifest schema: ... path/to/file CHECKSUM [CHECKSUM2] [CHECKSUM3] path/to/secondfile CHECKSUM [CHECKSUM2] [CHECKSUM3] ...

Example usage:

Parent(s)
\Task < \ProjectComponent
Author
David Persson  
Since
2.3.1  
Version
$Id: ManifestTask.php 552 2009-08-29 12:18:13Z mrook $  

Properties

Propertyprivatestring  $action= ''w''

Action

"r" or "w"

"w" for reading in files from fileSet and writing manifest

or

"r" for reading in files from fileSet and checking against manifest

Default value'w'Details
Type
string
Propertyprivatemixed  $checksum= 'false'

Enable/Disable checksuming or/and select algorithm true defaults to md5 false disables checksuming string "md5,sha256,..." enables generation of multiple checksums string "sha256" generates sha256 checksum only

Default valuefalseDetails
Type
mixed
Propertyprivate  $destFile= 'null'

The target file passed in the buildfile.

Default valuenullDetails
Type
n/a
Propertyprivatearray  $filesets= 'array()'

Holds filesets

An Array of objects
Default valuearray()Details
Type
array
Propertyprivatearray  $meta= 'array('totalFileCount' => 0'

Holds some data collected during runtime

Default valuearray('totalFileCount' => 0Details
Type
array
Propertyprivatestring  $salt= ''''

A string used in hashing method

Default value''Details
Type
string
Propertypublic  $taskname= ''manifest''
Default value'manifest'Details
Type
n/a

Methods

methodpubliccreateFileSet( ) : object

Nested creator, creates a FileSet for this task

Returns
Type Description
object The created fileset object
Details
Access
public  
methodpublicgetDescription( ) : void

methodpublicgetLocation( ) : void

methodpublicgetOwningTarget( ) : void

methodpublicgetProject( ) : void

methodprotectedgetRegisterSlot( ) : void

methodpublicgetRuntimeConfigurableWrapper( ) : void

methodpublicgetTaskName( ) : void

methodpublicgetTaskType( ) : void

methodprivatehash( string $msg, string $algo ) : mixed

Wrapper method for hash generation Automatically selects extension Falls back to built-in functions

Parameters
Name Type Description
$msg string

The string that should be hashed

$algo string

Algorithm

Returns
Type Description
mixed String on success, false if $algo is not available
Details
Link
http://www.php.net/mhash  
Link
http://www.php.net/hash  
methodprivatehashFile( string $file, string $algo ) : mixed

Hash a files contents plus it's size an modification time

Parameters
Name Type Description
$file string
$algo string
Returns
Type Description
mixed String on success, false if $algo is not available
methodpublicinit( ) : void

The init method: Do init steps.

methodpubliclog( ) : void

methodpublicmain( ) : void

Delegate the work

methodpublicmaybeConfigure( ) : void

methodpublicperform( ) : void

methodprivateread( ) : void

Details
Todo
implement  
methodpublicsetChecksum( mixed $mixed ) : void

The setter for the attribute "checksum"

Parameters
Name Type Description
$mixed mixed
methodpublicsetDescription( ) : void

methodpublicsetFile( string $file ) : void

The setter for the attribute "file" This is where the manifest will be written to/read from

Parameters
Name Type Description
$file string

Path to readable file

methodpublicsetLocation( ) : void

methodpublicsetOwningTarget( ) : void

methodpublicsetProject( ) : void

methodpublicsetRuntimeConfigurableWrapper( ) : void

methodpublicsetSalt( string $string ) : void

The setter for the optional attribute "salt"

Parameters
Name Type Description
$string string
methodpublicsetTaskName( ) : void

methodpublicsetTaskType( ) : void

methodprotectedvalidateAttributes( ) : void

Validates attributes coming in from XML

Throws
Exception Description
\BuildException
Details
Access
private  
methodprivatewrite( ) : void

Creates Manifest file Writes to $this->file

Throws
Exception Description
\BuildException
Documentation was generated by DocBlox 0.17.1.