![]() |
Bearsampp 2026.9.23
|
Public Member Functions | |
| __construct (&$config, $debug=false) | |
| _extractErrors ($err=null) | |
| & | factory ($version) |
| & | fromAnyFile ($info, $state) |
| & | fromArray ($arr) |
| & | fromPackageFile ($descfile, $state, $archive=false) |
| & | fromTgzFile ($file, $state) |
| & | fromXmlString ($data, $state, $file, $archive=false) |
| getClassPrefix () | |
| & | parserFactory ($version) |
| rawReturn () | |
| setLogger (&$l) | |
Static Public Member Functions | |
| static | addTempFile ($file) |
Data Fields | |
| $_config | |
| $_debug | |
| $_extractErrors = array() | |
| $_logger = false | |
| $_rawReturn = false | |
Definition at line 41 of file PackageFile.php.
| __construct | ( | & | $config, |
| $debug = false ) |
| PEAR_Config | $config | |
| ? | $debug | |
| string | @tmpdir Optional temporary directory for uncompressing files |
Definition at line 69 of file PackageFile.php.
References $config.
| _extractErrors | ( | $err = null | ) |
helper callback for extracting Archive_Tar errors
| PEAR_Error | null | $err |
Definition at line 388 of file PackageFile.php.
Referenced by fromTgzFile().
|
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 |
Definition at line 286 of file PackageFile.php.
References $GLOBALS.
Referenced by fromTgzFile().
| & factory | ( | $version | ) |
Create a PEAR_PackageFile_v* of a given version.
| int | $version |
Definition at line 123 of file PackageFile.php.
References getClassPrefix().
Referenced by fromArray().
| & fromAnyFile | ( | $info, | |
| $state ) |
Create a PEAR_PackageFile_v* from a .tgz archive or package.xml file.
This method is able to extract information about a package from a .tgz archive or from a XML package definition file.
@access public
| string | $info | file name |
| int | $state | package state (one of PEAR_VALIDATE_* constants) |
Definition at line 445 of file PackageFile.php.
References fromPackageFile(), and fromTgzFile().
| & fromArray | ( | $arr | ) |
Create a PEAR_PackageFile_v* from its toArray() method
WARNING: no validation is performed, the array is assumed to be valid, always parse from xml if you want validation.
| array | $arr |
Definition at line 146 of file PackageFile.php.
References factory().
| & fromPackageFile | ( | $descfile, | |
| $state, | |||
| $archive = false ) |
Create a PEAR_PackageFile_v* from a package.xml file.
@access public
| string | $descfile | name of package xml file |
| int | $state | package state (one of PEAR_VALIDATE_* constants) |
| string | false | $archive | name of the archive this package.xml came from, if any |
Definition at line 411 of file PackageFile.php.
References fromXmlString().
Referenced by fromAnyFile(), and fromTgzFile().
| & fromTgzFile | ( | $file, | |
| $state ) |
Create a PEAR_PackageFile_v* from a compressed Tar or Tgz file. @access public
| string | contents of package.xml file |
| int | package state (one of PEAR_VALIDATE_* constants) |
Definition at line 301 of file PackageFile.php.
References _extractErrors(), addTempFile(), fromPackageFile(), PEAR_ERROR_CALLBACK, and PEAR_ERROR_RETURN.
Referenced by fromAnyFile().
| & fromXmlString | ( | $data, | |
| $state, | |||
| $file, | |||
| $archive = false ) |
Create a PEAR_PackageFile_v* from an XML string. @access public
| string | $data | contents of package.xml file |
| int | $state | package state (one of PEAR_VALIDATE_* constants) |
| string | $file | full path to the package.xml file (and the files it references) |
| string | $archive | optional name of the archive that the XML was extracted from, if any |
Definition at line 186 of file PackageFile.php.
References parserFactory(), and PEAR_PACKAGEFILE_ERROR_NO_PACKAGEVERSION.
Referenced by fromPackageFile().
| getClassPrefix | ( | ) |
For simpler unit-testing
Definition at line 113 of file PackageFile.php.
Referenced by factory().
| & parserFactory | ( | $version | ) |
Create a PEAR_PackageFile_Parser_v* of a given version.
| int | $version |
Definition at line 95 of file PackageFile.php.
Referenced by fromXmlString().
| rawReturn | ( | ) |
Turn off validation - return a parsed package.xml without checking it
This is used by the package-validate command
Definition at line 80 of file PackageFile.php.
| setLogger | ( | & | $l | ) |
Definition at line 85 of file PackageFile.php.
| $_config |
Definition at line 46 of file PackageFile.php.
| $_debug |
Definition at line 47 of file PackageFile.php.
| $_extractErrors = array() |
Definition at line 60 of file PackageFile.php.
| $_logger = false |
Definition at line 49 of file PackageFile.php.
| $_rawReturn = false |
Definition at line 53 of file PackageFile.php.