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

Class: PEAR_Task_Replace

Source Location: /PEAR-1.6.2/PEAR/Task/Replace.php

Class Overview

PEAR_Task_Common
   |
   --PEAR_Task_Replace

Implements the replace file task.


Author(s):

Version:

  • Release: 1.6.2

Copyright:

  • 1997-2006 The PHP Group

Variables

Methods


Child classes:

PEAR_Task_Replace_rw
Abstracts the replace 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 37]
Implements the replace file task.


[ Top ]


Class Variables

$phase =  PEAR_TASK_PACKAGEANDINSTALL

[line 40]


Type:   mixed
Overrides:   Array


[ Top ]

$type =  'simple'

[line 39]


Type:   mixed
Overrides:   Array


[ Top ]



Method Detail

init   [line 102]

void init( array $xml, unused $attribs)

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
unused   $attribs   — 

[ Top ]

startSession   [line 117]

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

Do a package.xml 1.0 replacement, with additional package-info fields available

See validateXml() source for the complete list of allowed fields

  • Return: false to skip this file, PEAR_Error to fail (use $this->throwError), otherwise return the new contents

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 contents
string   $dest   —  the eventual final file location (informational only)

[ Top ]

validateXml   [line 50]

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

Validate the raw xml at parsing-time.

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

Parameters:

PEAR_PackageFile_v2   $pkg   — 
array   $xml   —  raw, parsed xml
PEAR_Config   &$config   — 
   $fileXml   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:09:37 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.