Class: PEAR_Common
Source Location: /PEAR-1.6.2/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
PEAR_Common (Constructor) [line 189]
PEAR_Common PEAR_Common(
)
|
|
PEAR_Common constructor
addTempFile [line 235]
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 648]
mixed analyzeSourceCode(
string
$file)
|
|
Analyze the source code of the given PHP file
Parameters:
betterStates [line 848]
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 592]
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 864]
void detectDependencies(
$any, [
$status_callback = null])
|
|
Parameters:
downloadHttp [line 1094]
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.
Overridden in child classes as:
- PEAR_Downloader::downloadHttp()
- Download a file through HTTP. Considers suggested file name in
Parameters:
getDependencyRelations [line 948]
array getDependencyRelations(
)
|
|
Get the implemented dependency relations (has, lt, ge etc.)
getDependencyTypes [line 934]
array getDependencyTypes(
)
|
|
Get the implemented dependency types (php, ext, pkg etc.)
getFileRoles [line 962]
Get the implemented file roles
getProvideTypes [line 990]
Get the implemented file replacement types in
getReleaseStates [line 920]
array getReleaseStates(
)
|
|
Get the valid package release states of packages
getReplacementTypes [line 976]
array getReplacementTypes(
)
|
|
Get the implemented file replacement types in
getScriptPhases [line 1004]
Get the implemented file replacement types in
getUserRoles [line 906]
Get the valid roles for a PEAR package maintainer
infoFromAny [line 485]
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 388]
array infoFromDescriptionFile(
string
$descfile)
|
|
Returns information about a package file. Expects the name of a package xml file as input.
Parameters:
infoFromString [line 419]
array infoFromString(
string
$data)
|
|
Returns information about a package file. Expects the contents of a package xml file as input.
Parameters:
infoFromTgzFile [line 357]
array infoFromTgzFile(
string
$file)
|
|
Returns information about a package file. Expects the name of a gzipped tar file as input.
Parameters:
isIncludeable [line 1109]
boolean isIncludeable(
string
$path)
|
|
Parameters:
log [line 279]
void log(
int
$level, string
$msg, [
$append_crlf = true])
|
|
Logging method.
Overridden in child classes as:
- PEAR_Builder::log()
Parameters:
mkDirHier [line 256]
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 308]
string mkTempDir(
[string
$tmpdir = ''])
|
|
Create and register a temporary directory.
Parameters:
setFrontendObject [line 336]
void setFrontendObject(
object Reference
&$ui)
|
|
Set object that represents the frontend to be used.
Parameters:
validatePackageInfo [line 543]
boolean validatePackageInfo(
string
$info,
&$errors,
&$warnings, [string
$dir_prefix = ''], array
$errors, array
$warnings)
|
|
Validate XML package definition file.
Parameters:
validPackageName [line 1021]
bool validPackageName(
string
$name)
|
|
Test whether a string contains a valid package name.
Parameters:
validPackageVersion [line 1039]
bool validPackageVersion(
string
$ver)
|
|
Test whether a string contains a valid package version.
Parameters:
xmlFromInfo [line 518]
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 15:09:35 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|