Bearsampp
2026.9.23
Toggle main menu visibility
Loading...
Searching...
No Matches
Common.php
Go to the documentation of this file.
1
<?php
18
define(
'PEAR_TASK_ERROR_NOATTRIBS'
, 1);
19
define(
'PEAR_TASK_ERROR_MISSING_ATTRIB'
, 2);
20
define(
'PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE'
, 3);
21
define(
'PEAR_TASK_ERROR_INVALID'
, 4);
23
define(
'PEAR_TASK_PACKAGE'
, 1);
24
define(
'PEAR_TASK_INSTALL'
, 2);
25
define(
'PEAR_TASK_PACKAGEANDINSTALL'
, 3);
55
class
PEAR_Task_Common
56
{
68
protected
$type
=
'simple'
;
72
public
$phase
=
PEAR_TASK_INSTALL
;
76
protected
$config
;
80
protected
$registry
;
84
public
$logger
;
88
protected
$installphase
;
93
function
__construct
(&
$config
, &
$logger
,
$phase
)
94
{
95
$this->config = &
$config
;
96
$this->registry = &
$config
->getRegistry();
97
$this->logger = &
$logger
;
98
$this->installphase =
$phase
;
99
if
($this->type ==
'multiple'
) {
100
$GLOBALS
[
'_PEAR_TASK_POSTINSTANCES'
][get_class($this)][] = &$this;
101
}
102
}
103
121
public
static
function
validateXml
($pkg, $xml,
$config
, $fileXml)
122
{
123
}
124
133
public
function
init
($xml, $fileAttributes, $lastVersion)
134
{
135
}
136
152
public
function
startSession
($pkg, $contents, $dest)
153
{
154
}
155
163
public
static
function
run
($tasks)
164
{
165
}
166
170
public
static
function
hasPostinstallTasks
()
171
{
172
return
isset(
$GLOBALS
[
'_PEAR_TASK_POSTINSTANCES'
]);
173
}
174
178
public
static
function
runPostinstallTasks
()
179
{
180
foreach
(
$GLOBALS
[
'_PEAR_TASK_POSTINSTANCES'
] as $class => $tasks) {
181
$err = call_user_func(
182
array($class,
'run'
),
183
$GLOBALS
[
'_PEAR_TASK_POSTINSTANCES'
][$class]
184
);
185
if
($err) {
186
return
PEAR_Task_Common::throwError
($err);
187
}
188
}
189
unset(
$GLOBALS
[
'_PEAR_TASK_POSTINSTANCES'
]);
190
}
191
196
public
function
isScript
()
197
{
198
return
$this->type ==
'script'
;
199
}
200
201
public
function
throwError
($msg, $code = -1)
202
{
203
include_once
'PEAR.php'
;
204
205
return
PEAR::raiseError($msg, $code);
206
}
207
}
$GLOBALS
$GLOBALS['_PEAR_default_error_mode']
Definition
PEAR.php:46
PEAR_TASK_INSTALL
const PEAR_TASK_INSTALL
Definition
Common.php:24
PEAR_Task_Common
Definition
Common.php:56
PEAR_Task_Common\$config
$config
Definition
Common.php:76
PEAR_Task_Common\$installphase
$installphase
Definition
Common.php:88
PEAR_Task_Common\init
init($xml, $fileAttributes, $lastVersion)
Definition
Common.php:133
PEAR_Task_Common\$registry
$registry
Definition
Common.php:80
PEAR_Task_Common\hasPostinstallTasks
static hasPostinstallTasks()
Definition
Common.php:170
PEAR_Task_Common\isScript
isScript()
Definition
Common.php:196
PEAR_Task_Common\startSession
startSession($pkg, $contents, $dest)
Definition
Common.php:152
PEAR_Task_Common\$type
$type
Definition
Common.php:68
PEAR_Task_Common\$phase
$phase
Definition
Common.php:72
PEAR_Task_Common\validateXml
static validateXml($pkg, $xml, $config, $fileXml)
Definition
Common.php:121
PEAR_Task_Common\runPostinstallTasks
static runPostinstallTasks()
Definition
Common.php:178
PEAR_Task_Common\throwError
throwError($msg, $code=-1)
Definition
Common.php:201
PEAR_Task_Common\__construct
__construct(&$config, &$logger, $phase)
Definition
Common.php:93
PEAR_Task_Common\run
static run($tasks)
Definition
Common.php:163
PEAR_Task_Common\$logger
$logger
Definition
Common.php:84
sandbox
core
libs
php
pear
pear
PEAR
Task
Common.php
Generated by
1.17.0