PEAR
[ class tree: PEAR ] [ index: PEAR ] [ all elements ]

Class: PEAR_Task_Postinstallscript

Source Location: /PEAR-1.9.4/PEAR/Task/Postinstallscript.php

Class Overview

PEAR_Task_Common
   |
   --PEAR_Task_Postinstallscript

Implements the postinstallscript file task.


Author(s):

Version:

  • Release: 1.9.4

Copyright:

  • 1997-2009 The Authors

Variables

Methods


Child classes:

PEAR_Task_Postinstallscript_rw
Abstracts the postinstallscript file task xml.

Inherited Variables

Inherited Methods

Class: PEAR_Task_Common

PEAR_Task_Common::PEAR_Task_Common()
PEAR_Task_Common::hasPostinstallTasks()
PEAR_Task_Common::init()
Initialize a task instance with the parameters
PEAR_Task_Common::isScript()
Determines whether a role is a script
PEAR_Task_Common::run()
This method is used to process each of the tasks for a particular multiple class type. Simple tasks need not implement this method.
PEAR_Task_Common::runPostinstallTasks()
PEAR_Task_Common::startSession()
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
PEAR_Task_Common::throwError()
PEAR_Task_Common::validateXml()
Validate the basic contents of a task tag.

Class Details

[line 34]
Implements the postinstallscript file task.

Note that post-install scripts are handled separately from installation, by the "pear run-scripts" command



[ Top ]


Class Variables

$phase =  PEAR_TASK_INSTALL

[line 46]


Type:   mixed
Overrides:   Array


[ Top ]

$type =  'script'

[line 36]


Type:   mixed
Overrides:   Array


[ Top ]



Method Detail

init   [line 231]

void init( array $xml, array $fileattribs, string|null $lastversion)

Initialize a task instance with the parameters

Overrides PEAR_Task_Common::init() (Initialize a task instance with the parameters)

Parameters:

array   $xml     raw, parsed xml
array   $fileattribs     attributes from the <file> tag containing this task
string|null   $lastversion     last installed version of this package, if any (useful for upgrades)

[ Top ]

run   [line 319]

void run( array 0, string 1)

No longer used

Overrides PEAR_Task_Common::run() (This method is used to process each of the tasks for a particular multiple class type. Simple tasks need not implement this method.)

Parameters:

array   0     an array of tasks
string   1     install or upgrade

[ Top ]

startSession   [line 279]

bool|PEAR_Error startSession( PEAR_PackageFile_v1|PEAR_PackageFile_v2 $pkg, string $contents)

Unlike other tasks, the installed file name is passed in instead of the file contents,

because this task is handled post-installation

  • Return: false to skip this file, PEAR_Error to fail (use $this->throwError)

Overrides PEAR_Task_Common::startSession() (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)

Parameters:

PEAR_PackageFile_v1|PEAR_PackageFile_v2   $pkg     
string   $contents     file name

[ Top ]

validateXml   [line 59]

void validateXml( PEAR_PackageFile_v2 $pkg, array $xml, PEAR_Config $config, array $fileXml)

Validate the raw xml at parsing-time.

This also attempts to validate the script to make sure it meets the criteria for a post-install script


Overrides PEAR_Task_Common::validateXml() (Validate the basic contents of a task tag.)

Parameters:

PEAR_PackageFile_v2   $pkg     
array   $xml     The XML contents of the <postinstallscript> tag
PEAR_Config   $config     
array   $fileXml     the entire parsed <file> tag

[ Top ]


Documentation generated on Wed, 06 Jul 2011 23:31:08 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.