Bearsampp 2026.9.23
Loading...
Searching...
No Matches
PEAR_Task_Postinstallscript_rw Class Reference
Inheritance diagram for PEAR_Task_Postinstallscript_rw:
Collaboration diagram for PEAR_Task_Postinstallscript_rw:

Public Member Functions

 __construct (&$pkg, &$config, &$logger, $fileXml)
 addConditionTypeGroup ($id, $oldgroup, $param, $value, $conditiontype='=', $params=false, $instructions=false)
 addParamGroup ($id, $params=false, $instructions=false)
 getName ()
 getParam ( $name, $prompt, $type='string', $default=null)
 getXml ()
 validate ()
Public Member Functions inherited from PEAR_Task_Postinstallscript
 _stripNamespace ($params=null)
 init ($xml, $fileattribs, $lastversion)
 startSession ($pkg, $contents, $dest)
Public Member Functions inherited from PEAR_Task_Common
 __construct (&$config, &$logger, $phase)
 isScript ()
 throwError ($msg, $code=-1)

Data Fields

 $_pkg
Data Fields inherited from PEAR_Task_Postinstallscript
 $_class
 $_contents
 $_obj
 $_params
 $_pkg
 $phase = PEAR_TASK_INSTALL
 $type = 'script'
Data Fields inherited from PEAR_Task_Common
 $logger
 $phase = PEAR_TASK_INSTALL

Additional Inherited Members

Static Public Member Functions inherited from PEAR_Task_Postinstallscript
static run ($tasks)
static validateXml ($pkg, $xml, $config, $fileXml)
Static Public Member Functions inherited from PEAR_Task_Common
static hasPostinstallTasks ()
static runPostinstallTasks ()
Protected Attributes inherited from PEAR_Task_Common
 $config
 $installphase
 $registry
 $type = 'simple'

Detailed Description

Definition at line 30 of file rw.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( & $pkg,
& $config,
& $logger,
$fileXml )

Enter description here...

Parameters
PEAR_PackageFile_v2_rw$pkgPackage
PEAR_Config$configConfig
PEAR_Frontend$loggerLogger
array$fileXmlXML
Returns
PEAR_Task_Postinstallscript_rw

Definition at line 48 of file rw.php.

49 {
50 parent::__construct($config, $logger, PEAR_TASK_PACKAGE);
51 $this->_contents = $fileXml;
52 $this->_pkg = &$pkg;
53 $this->_params = array();
54 }
const PEAR_TASK_PACKAGE
Definition Common.php:23

References PEAR_Task_Common\$config, PEAR_Task_Common\$logger, and PEAR_TASK_PACKAGE.

Member Function Documentation

◆ addConditionTypeGroup()

addConditionTypeGroup ( $id,
$oldgroup,
$param,
$value,
$conditiontype = '=',
$params = false,
$instructions = false )

Add a complex <paramgroup> to the post-install script with conditions

This inserts a <paramgroup> with

Order is significant, so call this method in the same sequence the users should see the paramgroups. The $params parameter should either be the result of a call to getParam() or an array of calls to getParam().

Use addParamGroup() to add a simple <paramgroup>

Parameters
string$id<paramgroup> id as seen by the script
string$oldgroup<paramgroup> id of the section referenced by <conditiontype>
string$paramname of the from the older section referenced by <contitiontype>
string$valuevalue to match of the parameter
string$conditiontypeone of '=', '!=', 'preg_match'
array | false$paramsarray of getParam() calls, or false for no params
string | false$instructions

Definition at line 121 of file rw.php.

128 {
129 if ($params && isset($params[0]) && !isset($params[1])) {
130 $params = $params[0];
131 }
132 $stuff = array(
133 $this->_pkg->getTasksNs().':id' => $id,
134 );
135 if ($instructions) {
136 $stuff[$this->_pkg->getTasksNs().':instructions'] = $instructions;
137 }
138 $stuff[$this->_pkg->getTasksNs().':name'] = $oldgroup.'::'.$param;
139 $stuff[$this->_pkg->getTasksNs().':conditiontype'] = $conditiontype;
140 $stuff[$this->_pkg->getTasksNs().':value'] = $value;
141 if ($params) {
142 $stuff[$this->_pkg->getTasksNs().':param'] = $params;
143 }
144 $this->_params[$this->_pkg->getTasksNs().':paramgroup'][] = $stuff;
145 }

◆ addParamGroup()

addParamGroup ( $id,
$params = false,
$instructions = false )

add a simple <paramgroup> to the post-install script

Order is significant, so call this method in the same sequence the users should see the paramgroups. The $params parameter should either be the result of a call to getParam() or an array of calls to getParam().

Use addConditionTypeGroup() to add a <paramgroup> containing a <conditiontype> tag

Parameters
string$id<paramgroup> id as seen by the script
array | false$paramsarray of getParam() calls, or false for no params
string | false$instructions

Definition at line 81 of file rw.php.

82 {
83 if ($params && isset($params[0]) && !isset($params[1])) {
84 $params = $params[0];
85 }
86 $stuff =
87 array(
88 $this->_pkg->getTasksNs().':id' => $id,
89 );
90 if ($instructions) {
91 $stuff[$this->_pkg->getTasksNs().':instructions'] = $instructions;
92 }
93 if ($params) {
94 $stuff[$this->_pkg->getTasksNs().':param'] = $params;
95 }
96 $this->_params[$this->_pkg->getTasksNs().':paramgroup'][] = $stuff;
97 }

◆ getName()

getName ( )

Definition at line 61 of file rw.php.

62 {
63 return 'postinstallscript';
64 }

◆ getParam()

getParam ( $name,
$prompt,
$type = 'string',
$default = null )

Use to set up a param tag for use in creating a paramgroup

Parameters
mixed$nameName of parameter
mixed$promptPrompt
string$typeType, defaults to 'string'
mixed$defaultDefault value
Returns
array

Definition at line 162 of file rw.php.

164 {
165 if ($default !== null) {
166 return
167 array(
168 $this->_pkg->getTasksNs().':name' => $name,
169 $this->_pkg->getTasksNs().':prompt' => $prompt,
170 $this->_pkg->getTasksNs().':type' => $type,
171 $this->_pkg->getTasksNs().':default' => $default,
172 );
173 }
174
175 return
176 array(
177 $this->_pkg->getTasksNs().':name' => $name,
178 $this->_pkg->getTasksNs().':prompt' => $prompt,
179 $this->_pkg->getTasksNs().':type' => $type,
180 );
181 }

References PEAR_Task_Postinstallscript\$type.

◆ getXml()

getXml ( )

Definition at line 147 of file rw.php.

References PEAR_Task_Postinstallscript\$_params.

◆ validate()

validate ( )

Definition at line 56 of file rw.php.

57 {
58 return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents);
59 }
static validateXml($pkg, $xml, $config, $fileXml)

References PEAR_Task_Postinstallscript\validateXml().

Here is the call graph for this function:

Field Documentation

◆ $_pkg

$_pkg

Definition at line 37 of file rw.php.


The documentation for this class was generated from the following file:
  • E:/Bearsampp-development/sandbox/core/libs/php/pear/pear/PEAR/Task/Postinstallscript/rw.php