Class: PEAR_Common
Source Location: /PEAR-1.3.5/PEAR/Common.php
PEAR
|
--PEAR_Common
Class providing common functionality for PEAR administration classes.
Author(s):
|
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Method Detail
PEAR_Common (Constructor) [line 157]
PEAR_Common PEAR_Common(
)
|
|
PEAR_Common constructor
addTempFile [line 200]
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 1300]
mixed analyzeSourceCode(
string
$file)
|
|
Analyze the source code of the given PHP file
Parameters:
betterStates [line 1497]
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 1244]
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 1513]
void detectDependencies(
$any, [
$status_callback = null])
|
|
Parameters:
downloadHttp [line 1742]
string downloadHttp(
string
$url,
&$ui, [string
$save_dir = '.'], [mixed
$callback = null], 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 1597]
array getDependencyRelations(
)
|
|
Get the implemented dependency relations (has, lt, ge etc.)
getDependencyTypes [line 1583]
array getDependencyTypes(
)
|
|
Get the implemented dependency types (php, ext, pkg etc.)
getFileRoles [line 1611]
Get the implemented file roles
getProvideTypes [line 1639]
Get the implemented file replacement types in
getReleaseStates [line 1569]
array getReleaseStates(
)
|
|
Get the valid package release states of packages
getReplacementTypes [line 1625]
array getReplacementTypes(
)
|
|
Get the implemented file replacement types in
getScriptPhases [line 1653]
Get the implemented file replacement types in
getUserRoles [line 1555]
Get the valid roles for a PEAR package maintainer
infoFromAny [line 836]
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 748]
array infoFromDescriptionFile(
string
$descfile)
|
|
Returns information about a package file. Expects the name of a package xml file as input.
Parameters:
infoFromString [line 775]
array infoFromString(
string
$data)
|
|
Returns information about a package file. Expects the contents of a package xml file as input.
Parameters:
infoFromTgzFile [line 697]
array infoFromTgzFile(
string
$file)
|
|
Returns information about a package file. Expects the name of a gzipped tar file as input.
Parameters:
log [line 237]
void log(
int
$level, string
$msg, [
$append_crlf = true])
|
|
Logging method.
Overridden in child classes as:
- PEAR_Builder::log()
Parameters:
mkDirHier [line 218]
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 262]
string mkTempDir(
[string
$tmpdir = ''])
|
|
Create and register a temporary directory.
Parameters:
setFrontendObject [line 287]
void setFrontendObject(
object Reference
&$ui)
|
|
Set object that represents the frontend to be used.
Parameters:
sortPkgDeps [line 1872]
array sortPkgDeps(
array
&$packages, [boolean
$uninstall = false])
|
|
Sort a list of arrays of array(downloaded packagefilename) by dependency. It also removes duplicate dependencies
Parameters:
validatePackageInfo [line 1043]
boolean validatePackageInfo(
string
$info,
&$errors,
&$warnings, [string
$dir_prefix = ''], array
$errors, array
$warnings)
|
|
Validate XML package definition file.
Parameters:
validPackageName [line 1670]
bool validPackageName(
string
$name)
|
|
Test whether a string contains a valid package name.
Parameters:
validPackageVersion [line 1688]
bool validPackageVersion(
string
$ver)
|
|
Test whether a string contains a valid package version.
Parameters:
xmlFromInfo [line 874]
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 Mon, 11 Mar 2019 14:23:55 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|