Class: PEAR_Common
Source Location: /PEAR-1.10.12/PEAR/Common.php
PEAR
|
--PEAR_Common
Class providing common functionality for PEAR administration classes.
Author(s):
Version:
Copyright:
|
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
__construct (Constructor) [line 167]
addTempFile [line 208]
void addTempFile(
string
$file)
|
|
Register a temporary file or directory. When the destructor is executed, all registered temporary files and directories are removed.
Parameters:
analyzeSourceCode [line 721]
mixed analyzeSourceCode(
string
$file)
|
|
Analyze the source code of the given PHP file
Parameters:
betterStates [line 307]
false|array betterStates(
string
$state, [boolean
$include = false])
|
|
Return an array containing all of the states that are more stable than or equal to the passed in state
Parameters:
buildProvidesArray [line 662]
void buildProvidesArray(
array
$srcinfo)
|
|
Build a "provides" array from data returned by analyzeSourceCode(). The format of the built array is like this: array( 'class;MyClass' => 'array('type' => 'class', 'name' => 'MyClass'), ... )
Parameters:
detectDependencies [line 731]
void detectDependencies(
$any, [
$status_callback = null])
|
|
Parameters:
downloadHttp [line 823]
mixed downloadHttp(
string
$url,
&$ui, [string
$save_dir = '.'], [mixed
$callback = null], [false|string|array
$lastmodified = null], [false|array
$accept = false], [false|string
$channel = false], object
$ui, object
$config)
|
|
Download a file through HTTP. Considers suggested file name in Content-disposition: header and can run a callback function for different events. The callback will be called with two parameters: the callback type, and parameters. The implemented callback types are: 'setup' called at the very beginning, parameter is a UI object that should be used for all output 'message' the parameter is a string with an informational message 'saveas' may be used to save with a different file name, the parameter is the filename that is about to be used. If a 'saveas' callback returns a non-empty string, that file name will be used as the filename instead. Note that $save_dir will not be affected by this, only the basename of the file. 'start' download is starting, parameter is number of bytes that are expected, or -1 if unknown 'bytesread' parameter is the number of bytes read so far 'done' download is complete, parameter is the total number of bytes read 'connfailed' if the TCP connection fails, this callback is called with array(host,port,errno,errmsg) 'writefailed' if writing to disk fails, this callback is called with array(destfile,errmsg) If an HTTP proxy has been configured (http_proxy PEAR_Config setting), the proxy will be used.
Parameters:
getDependencyRelations [line 355]
array getDependencyRelations(
)
|
|
Get the implemented dependency relations (has, lt, ge etc.)
getDependencyTypes [line 345]
array getDependencyTypes(
)
|
|
Get the implemented dependency types (php, ext, pkg etc.)
getFileRoles [line 365]
Get the implemented file roles
getProvideTypes [line 385]
Get the implemented file replacement types in
getReleaseStates [line 335]
array getReleaseStates(
)
|
|
Get the valid package release states of packages
getReplacementTypes [line 375]
array getReplacementTypes(
)
|
|
Get the implemented file replacement types in
getScriptPhases [line 395]
Get the implemented file replacement types in
getUserRoles [line 325]
Get the valid roles for a PEAR package maintainer
infoFromAny [line 558]
string infoFromAny(
string
$info)
|
|
Returns package information from different sources This method is able to extract information about a package from a .tgz archive or from a XML package definition file.
Parameters:
infoFromDescriptionFile [line 496]
array infoFromDescriptionFile(
string
$descfile)
|
|
Returns information about a package file. Expects the name of a package xml file as input.
Parameters:
infoFromString [line 515]
array infoFromString(
string
$data)
|
|
Returns information about a package file. Expects the contents of a package xml file as input.
Parameters:
infoFromTgzFile [line 477]
array infoFromTgzFile(
string
$file)
|
|
Returns information about a package file. Expects the name of a gzipped tar file as input.
Parameters:
isIncludeable [line 432]
boolean isIncludeable(
string
$path)
|
|
Parameters:
log [line 244]
void log(
int
$level, string
$msg, [
$append_crlf = true])
|
|
Logging method.
Overridden in child classes as:
- PEAR_Builder::log()
Parameters:
mkDirHier [line 226]
bool mkDirHier(
string
$dir)
|
|
Wrapper to System::mkDir(), creates a directory as well as any necessary parent directories.
Overridden in child classes as:
- PEAR_Installer::mkDirHier()
Parameters:
mkTempDir [line 271]
string mkTempDir(
[string
$tmpdir = ''])
|
|
Create and register a temporary directory.
Parameters:
setFrontendObject [line 294]
void setFrontendObject(
object Reference
&$ui)
|
|
Set object that represents the frontend to be used.
Parameters:
validatePackageInfo [line 613]
boolean validatePackageInfo(
string
$info,
&$errors,
&$warnings, [string
$dir_prefix = ''], array
$errors, array
$warnings)
|
|
Validate XML package definition file.
Parameters:
validPackageName [line 409]
bool validPackageName(
string
$name)
|
|
Test whether a string contains a valid package name.
Parameters:
validPackageVersion [line 423]
bool validPackageVersion(
string
$ver)
|
|
Test whether a string contains a valid package version.
Parameters:
xmlFromInfo [line 591]
string xmlFromInfo(
array
$pkginfo)
|
|
Return an XML document based on the package info (as returned by the PEAR_Common::infoFrom* methods).
Parameters:
Documentation generated on Sun, 19 Apr 2020 14:22:12 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|