[ PHPXref.com ] [ Generated: Sun Jul 20 19:19:39 2008 ] [ PEAR 1.4.5 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]




/PEAR/Task/ -> Common.php (summary)

PEAR_Task_Common, base class for installer tasks PHP versions 4 and 5

Author: Greg Beaver
Copyright: 1997-2005 The PHP Group
License: http://www.php.net/license/3_0.txt PHP License 3.0
Version: CVS: $Id: Common.php,v 1.14 2005/09/18 06:32:00 cellog Exp $
File Size: 208 lines (7 kb)
Included or required: 5 times
Referenced: 3 times
Includes or requires: 1 file

Defines 1 class

PEAR_Task_Common:: (9 methods):

Class: PEAR_Task_Common  - X-Ref

A task is an operation that manipulates the contents of a file.

Simple tasks operate on 1 file.  Multiple tasks are executed after all files have been
processed and installed, and are designed to operate on all files containing the task.
The Post-install script task simply takes advantage of the fact that it will be run
after installation, replace is a simple task.

Combining tasks is possible, but ordering is significant.

<file name="test.php" role="php">
<tasks:replace from="@data-dir@" to="data_dir" type="pear-config"/>

This will first replace any instance of @data-dir@ in the test.php file
with the path to the current data directory.  Then, it will include the
test.php file and run the script it contains to configure the package post-installation.
PEAR_Task_Common(&$config, &$logger, $phase)   X-Ref

param: PEAR_Config
param: PEAR_Common

validXml($pkg, $xml, &$config, $fileXml)   X-Ref
Validate the basic contents of a task tag.

param: PEAR_PackageFile_v2
param: array
param: PEAR_Config
param: array the entire parsed <file> tag
return: true|array On error, return an array in format:

init($xml, $fileAttributes, $lastVersion)   X-Ref
Initialize a task instance with the parameters

param: array raw, parsed xml
param: array attributes from the <file> tag containing this task
param: string|null last installed version of this package

startSession($pkg, $contents, $dest)   X-Ref
Begin a task processing session.  All multiple tasks will be processed after each file
has been successfully installed, all simple tasks should perform their task here and
return any errors using the custom throwError() method to allow forward compatibility

This method MUST NOT write out any changes to disk
param: PEAR_PackageFile_v2
param: string file contents
param: string the eventual final file location (informational only)
return: string|false|PEAR_Error false to skip this file, PEAR_Error to fail

run($tasks)   X-Ref
This method is used to process each of the tasks for a particular multiple class
type.  Simple tasks need not implement this method.

param: array an array of tasks

hasPostinstallTasks()   X-Ref

runPostinstallTasks()   X-Ref

isScript()   X-Ref
Determines whether a role is a script

return: bool

throwError($msg, $code = -1)   X-Ref
No description

[ Powered by PHPXref - Served by Debian GNU/Linux ]