classes/phing/tasks/ext/ManifestTask.php

\ManifestTask

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:

Extends from
\Task
author
David Persson
copyright
2001,2002 THYRELL. All rights reserved
package
phing.tasks.ext
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 valuewDetails
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
Propertyprivatearray  $filesets= 'array'

Holds filesets

An Array of objects
Default valuearrayDetails
Type
array
Propertyprivatearray  $meta= 'array'

Holds some data collected during runtime

Default valuearrayDetails
Type
array
Propertyprivatestring  $salt= ''

A string used in hashing method

Details
Type
string
Propertypublic  $taskname= 'manifest'
Default valuemanifestDetails
Type

Methods

methodpublic  createFileSet( ) : object
Nested creator, creates a FileSet for this task
Returns
Type Description
object
Details
access
public
methodprivate  hash( 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
Details
link
http://www.php.net/mhash
link
http://www.php.net/hash
methodprivate  hashFile( 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
methodpublic  init( ) :
The init method: Do init steps.
methodpublic  main( ) :
Delegate the work
methodprivate  read( ) :
Details
todo
implement
methodpublic  setChecksum( mixed $mixed ) : void
The setter for the attribute "checksum"
Parameters
Name Type Description
$mixed mixed
methodpublic  setFile( 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
methodpublic  setSalt( string $string ) : void
The setter for the optional attribute "salt"
Parameters
Name Type Description
$string string
methodprotected  validateAttributes( ) : void
Validates attributes coming in from XML
Details
access
private
throws
methodprivate  write( ) :
Creates Manifest file Writes to $this->file
Details
throws
Documentation was generated by DocBlox 0.13.1.