[ Index ] |
|
Code source de GeekLog 1.4.1 |
[Code source] [Imprimer] [Statistiques]
PEAR_Common, the base class for the PEAR Installer PHP versions 4 and 5
Author: | Stig Bakken <ssb@php.net> |
Author: | Tomas V. V. Cox <cox@idecnet.com> |
Author: | Greg Beaver <cellog@php.net> |
Copyright: | 1997-2006 The PHP Group |
License: | http://www.php.net/license/3_0.txt PHP License 3.0 |
Version: | CVS: $Id: Common.php,v 1.155 2006/03/02 18:14:12 cellog Exp $ |
Poids: | 1129 lignes (36 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
PEAR_Common:: (30 méthodes):
PEAR_Common()
_PEAR_Common()
addTempFile()
mkDirHier()
log()
mkTempDir()
setFrontendObject()
infoFromTgzFile()
infoFromDescriptionFile()
infoFromString()
_postProcessValidPackagexml()
infoFromAny()
xmlFromInfo()
validatePackageInfo()
buildProvidesArray()
analyzeSourceCode()
betterStates()
detectDependencies()
getUserRoles()
getReleaseStates()
getDependencyTypes()
getDependencyRelations()
getFileRoles()
getReplacementTypes()
getProvideTypes()
getScriptPhases()
validPackageName()
validPackageVersion()
downloadHttp()
isIncludeable()
Classe: PEAR_Common - X-Ref
Class providing common functionality for PEAR administration classes.PEAR_Common() X-Ref |
PEAR_Common constructor |
_PEAR_Common() X-Ref |
PEAR_Common destructor |
addTempFile($file) X-Ref |
Register a temporary file or directory. When the destructor is executed, all registered temporary files and directories are removed. param: string $file name of file or directory return: void |
mkDirHier($dir) X-Ref |
Wrapper to System::mkDir(), creates a directory as well as any necessary parent directories. param: string $dir directory name return: bool TRUE on success, or a PEAR error |
log($level, $msg, $append_crlf = true) X-Ref |
Logging method. param: int $level log level (0 is quiet, higher is noisier) param: string $msg message to write to the log return: void |
mkTempDir($tmpdir = '') X-Ref |
Create and register a temporary directory. param: string $tmpdir (optional) Directory to use as tmpdir. return: string name of created directory |
setFrontendObject(&$ui) X-Ref |
Set object that represents the frontend to be used. param: object Reference of the frontend object return: void |
infoFromTgzFile($file) X-Ref |
Returns information about a package file. Expects the name of a gzipped tar file as input. param: string $file name of .tgz file return: array array with package information |
infoFromDescriptionFile($descfile) X-Ref |
Returns information about a package file. Expects the name of a package xml file as input. param: string $descfile name of package xml file return: array array with package information |
infoFromString($data) X-Ref |
Returns information about a package file. Expects the contents of a package xml file as input. param: string $data contents of package.xml file return: array array with package information |
_postProcessValidPackagexml(&$pf) X-Ref |
param: PEAR_PackageFile_v1|PEAR_PackageFile_v2 return: array |
infoFromAny($info) X-Ref |
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. param: string Filename of the source ('package.xml', '<package>.tgz') return: string |
xmlFromInfo($pkginfo) X-Ref |
Return an XML document based on the package info (as returned by the PEAR_Common::infoFrom* methods). param: array $pkginfo package info return: string XML data |
validatePackageInfo($info, &$errors, &$warnings, $dir_prefix = '') X-Ref |
Validate XML package definition file. param: string $info Filename of the package archive or of the param: array $errors Array that will contain the errors param: array $warnings Array that will contain the warnings param: string $dir_prefix (optional) directory where source files return: boolean |
buildProvidesArray($srcinfo) X-Ref |
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'), ... ) param: array $srcinfo array with information about a source file return: void |
analyzeSourceCode($file) X-Ref |
Analyze the source code of the given PHP file param: string Filename of the PHP file return: mixed |
betterStates($state, $include = false) X-Ref |
Return an array containing all of the states that are more stable than or equal to the passed in state param: string Release state param: boolean Determines whether to include $state in the list return: false|array False if $state is not a valid release state |
detectDependencies($any, $status_callback = null) X-Ref |
Pas de description |
getUserRoles() X-Ref |
Get the valid roles for a PEAR package maintainer return: array |
getReleaseStates() X-Ref |
Get the valid package release states of packages return: array |
getDependencyTypes() X-Ref |
Get the implemented dependency types (php, ext, pkg etc.) return: array |
getDependencyRelations() X-Ref |
Get the implemented dependency relations (has, lt, ge etc.) return: array |
getFileRoles() X-Ref |
Get the implemented file roles return: array |
getReplacementTypes() X-Ref |
Get the implemented file replacement types in return: array |
getProvideTypes() X-Ref |
Get the implemented file replacement types in return: array |
getScriptPhases() X-Ref |
Get the implemented file replacement types in return: array |
validPackageName($name) X-Ref |
Test whether a string contains a valid package name. param: string $name the package name to test return: bool |
validPackageVersion($ver) X-Ref |
Test whether a string contains a valid package version. param: string $ver the package version to test return: bool |
downloadHttp($url, &$ui, $save_dir = '.', $callback = null) X-Ref |
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. param: string $url the URL to download param: object $ui PEAR_Frontend_* instance param: object $config PEAR_Config instance param: string $save_dir (optional) directory to save file in param: mixed $callback (optional) function/method to call for status return: string Returns the full path of the downloaded file or a PEAR |
isIncludeable($path) X-Ref |
param: string $path relative or absolute include path return: boolean |
Généré le : Wed Nov 21 12:27:40 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |