PHP Класс PEAR_PackageFile

Автор: Greg Beaver ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$_config PEAR_Config
$_debug
$_extractErrors array helper for extracting Archive_Tar errors
$_logger
$_rawReturn boolean

Открытые методы

Метод Описание
PEAR_PackageFile ( PEAR_Config &$config, ? $debug = false )
_extractErrors ( PEAR_Error | null $err = null ) : array helper callback for extracting Archive_Tar errors
addTempFile ( string $file ) : void Register a temporary file or directory. When the destructor is executed, all registered temporary files and directories are removed.
factory ( integer $version ) : PEAR_PackageFile_v1 Create a PEAR_PackageFile_v* of a given version.
fromAnyFile ( string $info, integer $state ) : PEAR_PackageFile_v1 | PEAR_PackageFile_v2 Create a PEAR_PackageFile_v* from a .tgz archive or package.xml file.
fromArray ( array $arr ) : PEAR_PackageFileManager_v1 | PEAR_PackageFileManager_v2 Create a PEAR_PackageFile_v* from its toArray() method
fromPackageFile ( string $descfile, integer $state, string | false $archive = false ) : PEAR_PackageFile_v1 | PEAR_PackageFile_v2 Create a PEAR_PackageFile_v* from a package.xml file.
fromTgzFile ( $file, $state ) : PEAR_PackageFile_v1 | PEAR_PackageFile_v2 Create a PEAR_PackageFile_v* from a compresed Tar or Tgz file.
fromXmlString ( string $data, integer $state, string $file, string $archive = false ) : PEAR_PackageFile_v1 | PEAR_PackageFile_v2 Create a PEAR_PackageFile_v* from an XML string.
getClassPrefix ( ) : string For simpler unit-testing
parserFactory ( integer $version ) : PEAR_PackageFile_Parser_v1 Create a PEAR_PackageFile_Parser_v* of a given version.
rawReturn ( ) Turn off validation - return a parsed package.xml without checking it
setLogger ( &$l )

Описание методов

PEAR_PackageFile() публичный Метод

public PEAR_PackageFile ( PEAR_Config &$config, ? $debug = false )
$config PEAR_Config
$debug ?

_extractErrors() публичный Метод

helper callback for extracting Archive_Tar errors
public _extractErrors ( PEAR_Error | null $err = null ) : array
$err PEAR_Error | null
Результат array

addTempFile() публичный Метод

Register a temporary file or directory. When the destructor is executed, all registered temporary files and directories are removed.
public addTempFile ( string $file ) : void
$file string name of file or directory
Результат void

factory() публичный Метод

Create a PEAR_PackageFile_v* of a given version.
public factory ( integer $version ) : PEAR_PackageFile_v1
$version integer
Результат PEAR_PackageFile_v1

fromAnyFile() публичный Метод

This method is able to extract information about a package from a .tgz archive or from a XML package definition file.
public fromAnyFile ( string $info, integer $state ) : PEAR_PackageFile_v1 | PEAR_PackageFile_v2
$info string file name
$state integer package state (one of PEAR_VALIDATE_* constants)
Результат PEAR_PackageFile_v1 | PEAR_PackageFile_v2

fromArray() публичный Метод

WARNING: no validation is performed, the array is assumed to be valid, always parse from xml if you want validation.
public fromArray ( array $arr ) : PEAR_PackageFileManager_v1 | PEAR_PackageFileManager_v2
$arr array
Результат PEAR_PackageFileManager_v1 | PEAR_PackageFileManager_v2

fromPackageFile() публичный Метод

Create a PEAR_PackageFile_v* from a package.xml file.
public fromPackageFile ( string $descfile, integer $state, string | false $archive = false ) : PEAR_PackageFile_v1 | PEAR_PackageFile_v2
$descfile string name of package xml file
$state integer package state (one of PEAR_VALIDATE_* constants)
$archive string | false name of the archive this package.xml came from, if any
Результат PEAR_PackageFile_v1 | PEAR_PackageFile_v2

fromTgzFile() публичный Метод

Create a PEAR_PackageFile_v* from a compresed Tar or Tgz file.
public fromTgzFile ( $file, $state ) : PEAR_PackageFile_v1 | PEAR_PackageFile_v2
Результат PEAR_PackageFile_v1 | PEAR_PackageFile_v2

fromXmlString() публичный Метод

Create a PEAR_PackageFile_v* from an XML string.
public fromXmlString ( string $data, integer $state, string $file, string $archive = false ) : PEAR_PackageFile_v1 | PEAR_PackageFile_v2
$data string contents of package.xml file
$state integer package state (one of PEAR_VALIDATE_* constants)
$file string full path to the package.xml file (and the files it references)
$archive string optional name of the archive that the XML was extracted from, if any
Результат PEAR_PackageFile_v1 | PEAR_PackageFile_v2

getClassPrefix() публичный Метод

For simpler unit-testing
public getClassPrefix ( ) : string
Результат string

parserFactory() публичный Метод

Create a PEAR_PackageFile_Parser_v* of a given version.
public parserFactory ( integer $version ) : PEAR_PackageFile_Parser_v1
$version integer
Результат PEAR_PackageFile_Parser_v1

rawReturn() публичный Метод

This is used by the package-validate command
public rawReturn ( )

setLogger() публичный Метод

public setLogger ( &$l )

Описание свойств

$_config публичное свойство

public PEAR_Config $_config
Результат PEAR_Config

$_debug публичное свойство

public $_debug

$_extractErrors публичное свойство

helper for extracting Archive_Tar errors
public array $_extractErrors
Результат array

$_logger публичное свойство

public $_logger

$_rawReturn публичное свойство

public bool $_rawReturn
Результат boolean