![]() |
Bearsampp 2026.9.23
|
Public Member Functions | |
| __construct () | |
| _PEAR_Common () | |
| _postProcessChecks ($pf) | |
| _postProcessValidPackagexml (&$pf) | |
| buildProvidesArray ($srcinfo) | |
| detectDependencies ($any, $status_callback=null) | |
| downloadHttp ( $url, &$ui, $save_dir='.', $callback=null, $lastmodified=null, $accept=false, $channel=false) | |
| infoFromAny ($info) | |
| infoFromDescriptionFile ($descfile) | |
| infoFromString ($data) | |
| infoFromTgzFile ($file) | |
| log ($level, $msg, $append_crlf=true) | |
| mkDirHier ($dir) | |
| mkTempDir ($tmpdir='') | |
| setFrontendObject (&$ui) | |
| validatePackageInfo ($info, &$errors, &$warnings, $dir_prefix='') | |
| validPackageName ($name) | |
| validPackageVersion ($ver) | |
| xmlFromInfo ($pkginfo) | |
| Public Member Functions inherited from PEAR | |
| __call ($method, $arguments) | |
| __construct ($error_class=null) | |
| _checkDelExpect ($error_code) | |
| _PEAR () | |
| delExpect ($error_code) | |
| expectError ($code=' *') | |
| PEAR ($error_class=null) | |
| popExpect () | |
Static Public Member Functions | |
| static | addTempFile ($file) |
| static | analyzeSourceCode ($file) |
| static | betterStates ($state, $include=false) |
| static | getDependencyRelations () |
| static | getDependencyTypes () |
| static | getFileRoles () |
| static | getProvideTypes () |
| static | getReleaseStates () |
| static | getReplacementTypes () |
| static | getScriptPhases () |
| static | getUserRoles () |
| static | isIncludeable ($path) |
| Static Public Member Functions inherited from PEAR | |
| static | __callStatic ($method, $arguments) |
| static | getSourceDateEpoch () |
| static & | getStaticProperty ($class, $var) |
| static | isError ($data, $code=null) |
| static | loadExtension ($ext) |
| static | registerShutdownFunc ($func, $args=array()) |
| static | staticPopErrorHandling () |
| static | staticPushErrorHandling ($mode, $options=null) |
Data Fields | |
| $_validPackageFile | |
| $config = null | |
| $current_attributes = array() | |
| $current_element | |
| $current_path = null | |
| $element_stack = array() | |
| $pkginfo = array() | |
| $ui = null | |
| Data Fields inherited from PEAR | |
| $_debug = false | |
| $_default_error_handler = '' | |
| $_default_error_mode = null | |
| $_default_error_options = null | |
| $_error_class = 'PEAR_Error' | |
| $_expected_errors = array() | |
Additional Inherited Members | |
| Static Protected Member Functions inherited from PEAR | |
| static | _popErrorHandling ($object) |
| static | _pushErrorHandling ($object, $mode, $options=null) |
| static | _raiseError ($object, $message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false) |
| static | _setErrorHandling ( $object, $mode=null, $options=null) |
| static | _throwError ($object, $message=null, $code=null, $userinfo=null) |
| Static Protected Attributes inherited from PEAR | |
| static | $bivalentMethods |
Definition at line 126 of file Common.php.
| __construct | ( | ) |
PEAR_Common constructor
@access public
Definition at line 167 of file Common.php.
| _PEAR_Common | ( | ) |
PEAR_Common destructor
@access private
Definition at line 179 of file Common.php.
References $GLOBALS.
| _postProcessChecks | ( | $pf | ) |
Definition at line 449 of file Common.php.
References _postProcessValidPackagexml(), and PEAR\isError().
Referenced by infoFromDescriptionFile(), infoFromString(), and infoFromTgzFile().
| _postProcessValidPackagexml | ( | & | $pf | ) |
| PEAR_PackageFile_v1|PEAR_PackageFile_v2 |
Definition at line 526 of file Common.php.
References $pkginfo.
Referenced by _postProcessChecks(), and infoFromAny().
|
static |
Register a temporary file or directory. When the destructor is executed, all registered temporary files and directories are removed.
| string | $file | name of file or directory |
@access public
Definition at line 208 of file Common.php.
References PEAR_Frontend\addTempFile().
Referenced by PEAR_Builder\build(), and mkTempDir().
|
static |
Analyze the source code of the given PHP file
| string | Filename of the PHP file |
Definition at line 721 of file Common.php.
References PEAR_PackageFile_v2_Validator\analyzeSourceCode().
Referenced by detectDependencies().
|
static |
Return an array containing all of the states that are more stable than or equal to the passed in state
| string | Release state |
| boolean | Determines whether to include $state in the list |
Definition at line 307 of file Common.php.
Referenced by PEAR_Downloader_Package\_analyzeDownloadURL(), and PEAR_Command_Remote\doListUpgrades().
| buildProvidesArray | ( | $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'), ... )
| array | $srcinfo | array with information about a source file as returned by the analyzeSourceCode() method. |
@access public
Definition at line 662 of file Common.php.
| detectDependencies | ( | $any, | |
| $status_callback = null ) |
Definition at line 731 of file Common.php.
References analyzeSourceCode(), infoFromAny(), and PEAR\isError().
| downloadHttp | ( | $url, | |
| & | $ui, | ||
| $save_dir = '.', | |||
| $callback = null, | |||
| $lastmodified = null, | |||
| $accept = false, | |||
| $channel = false ) |
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.
| string | $url | the URL to download |
| object | $ui | PEAR_Frontend_* instance |
| object | $config | PEAR_Config instance |
| string | $save_dir | (optional) directory to save file in |
| mixed | $callback | (optional) function/method to call for status updates |
| false | string | array | $lastmodified | header values to check against for caching use false to return the header values from this download |
| false | array | $accept | Accept headers to send |
| false | string | $channel | Channel to use for retrieving authentication |
@access public
Definition at line 823 of file Common.php.
References $ui, and PEAR_Downloader\_downloadHttp().
Referenced by PEAR_Downloader\discover(), and PEAR_Downloader\download().
|
static |
Get the implemented dependency relations (has, lt, ge etc.)
Definition at line 355 of file Common.php.
References $GLOBALS.
Referenced by PEAR_PackageFile_v1\validate().
|
static |
Get the implemented dependency types (php, ext, pkg etc.)
Definition at line 345 of file Common.php.
References $GLOBALS.
Referenced by PEAR_PackageFile_v1\validate().
|
static |
Get the implemented file roles
Definition at line 365 of file Common.php.
References $GLOBALS.
Referenced by PEAR_Command_Pickle\_convertPackage(), and PEAR_PackageFile_v1\validate().
|
static |
Get the implemented file replacement types in
Definition at line 385 of file Common.php.
References $GLOBALS.
|
static |
Get the valid package release states of packages
Definition at line 335 of file Common.php.
References $GLOBALS.
|
static |
Get the implemented file replacement types in
Definition at line 375 of file Common.php.
References $GLOBALS.
|
static |
Get the implemented file replacement types in
Definition at line 395 of file Common.php.
References $GLOBALS.
|
static |
Get the valid roles for a PEAR package maintainer
Definition at line 325 of file Common.php.
References $GLOBALS.
Referenced by PEAR_PackageFile_v1\validate().
| infoFromAny | ( | $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.
@access public
| string | Filename of the source ('package.xml', '<package>.tgz') |
Definition at line 558 of file Common.php.
References _postProcessValidPackagexml(), PEAR\isError(), and PEAR_VALIDATE_NORMAL.
Referenced by detectDependencies().
| infoFromDescriptionFile | ( | $descfile | ) |
Returns information about a package file. Expects the name of a package xml file as input.
| string | $descfile | name of package xml file |
@access public
Definition at line 496 of file Common.php.
References _postProcessChecks(), and PEAR_VALIDATE_NORMAL.
| infoFromString | ( | $data | ) |
Returns information about a package file. Expects the contents of a package xml file as input.
| string | $data | contents of package.xml file |
@access public
Definition at line 515 of file Common.php.
References _postProcessChecks(), and PEAR_VALIDATE_NORMAL.
| infoFromTgzFile | ( | $file | ) |
Returns information about a package file. Expects the name of a gzipped tar file as input.
| string | $file | name of .tgz file |
@access public
Definition at line 477 of file Common.php.
References _postProcessChecks(), and PEAR_VALIDATE_NORMAL.
|
static |
| string | $path | relative or absolute include path |
Definition at line 432 of file Common.php.
| log | ( | $level, | |
| $msg, | |||
| $append_crlf = true ) |
Logging method.
| int | $level | log level (0 is quiet, higher is noisier) |
| string | $msg | message to write to the log |
Reimplemented in PEAR_Builder.
Definition at line 244 of file Common.php.
References $ui, and PEAR_Frontend\singleton().
Referenced by PEAR_Installer\_compileSourceFiles(), PEAR_Downloader\_downloadCallback(), PEAR_Downloader\_getDepPackageDownloadUrl(), PEAR_Installer\_installFile(), PEAR_Installer\_installFile2(), PEAR_Installer\_parsePackageXml(), PEAR_Installer\addFileOperation(), PEAR_Downloader\analyzeDependencies(), PEAR_Installer\commitFileTransaction(), PEAR_Downloader\discover(), PEAR_Downloader\download(), PEAR_Downloader\getDownloadDir(), PEAR_Installer\install(), mkDirHier(), PEAR_Packager\package(), PEAR_Installer\rollbackFileTransaction(), and PEAR_Installer\uninstall().
| mkDirHier | ( | $dir | ) |
Wrapper to System::mkDir(), creates a directory as well as any necessary parent directories.
| string | $dir | directory name |
@access public
Reimplemented in PEAR_Installer.
Definition at line 226 of file Common.php.
References log().
| mkTempDir | ( | $tmpdir = '' | ) |
Create and register a temporary directory.
| string | $tmpdir | (optional) Directory to use as tmpdir. Will use system defaults (for example /tmp or c:\windows\temp) if not specified |
@access public
Definition at line 271 of file Common.php.
References addTempFile().
| setFrontendObject | ( | & | $ui | ) |
Set object that represents the frontend to be used.
| object | Reference of the frontend object |
Definition at line 294 of file Common.php.
References $ui.
Referenced by PEAR_Builder\__construct(), and PEAR_Installer\__construct().
| validatePackageInfo | ( | $info, | |
| & | $errors, | ||
| & | $warnings, | ||
| $dir_prefix = '' ) |
Validate XML package definition file.
| string | $info | Filename of the package archive or of the package definition file |
| array | $errors | Array that will contain the errors |
| array | $warnings | Array that will contain the warnings |
| string | $dir_prefix | (optional) directory where source files may be found, or empty if they are not available @access public |
Definition at line 613 of file Common.php.
References $config, PEAR\isError(), PEAR_ERROR_RETURN, PEAR_VALIDATE_NORMAL, PEAR\staticPopErrorHandling(), and PEAR\staticPushErrorHandling().
| validPackageName | ( | $name | ) |
Test whether a string contains a valid package name.
| string | $name | the package name to test |
@access public
Definition at line 409 of file Common.php.
References PEAR_COMMON_PACKAGE_NAME_PREG.
| validPackageVersion | ( | $ver | ) |
Test whether a string contains a valid package version.
| string | $ver | the package version to test |
@access public
Definition at line 423 of file Common.php.
References PEAR_COMMON_PACKAGE_VERSION_PREG.
| xmlFromInfo | ( | $pkginfo | ) |
Return an XML document based on the package info (as returned by the PEAR_Common::infoFrom* methods).
| array | $pkginfo | package info |
@access public
Definition at line 591 of file Common.php.
References $config, $pkginfo, and PEAR_VALIDATE_PACKAGING.
| $_validPackageFile |
Definition at line 160 of file Common.php.
| $config = null |
Definition at line 139 of file Common.php.
Referenced by PEAR_Downloader\__construct(), PEAR_Downloader\_downloadHttp(), PEAR_Installer\setConfig(), validatePackageInfo(), and xmlFromInfo().
| $current_attributes = array() |
array of attributes of the currently parsed XML element
Definition at line 148 of file Common.php.
| $current_element |
name of currently parsed XML element
Definition at line 145 of file Common.php.
| $current_path = null |
Definition at line 153 of file Common.php.
| $element_stack = array() |
stack of elements, gives some sort of XML context
Definition at line 142 of file Common.php.
| $pkginfo = array() |
assoc with information about a package
Definition at line 151 of file Common.php.
Referenced by _postProcessValidPackagexml(), and xmlFromInfo().
| $ui = null |
Definition at line 133 of file Common.php.
Referenced by PEAR_Builder\__construct(), PEAR_Downloader\__construct(), PEAR_Installer\__construct(), PEAR_Downloader\_downloadHttp(), downloadHttp(), log(), and setFrontendObject().