PEAR
[ class tree: PEAR ] [ index: PEAR ] [ all elements ]

Class: PEAR_PackageFile

Source Location: /PEAR-1.10.12/PEAR/PackageFile.php

Class Overview


Abstraction for the package.xml package description file


Author(s):

Version:

  • Release: 1.10.12

Copyright:

  • 1997-2009 The Authors

Methods


Inherited Variables

Inherited Methods


Class Details

[line 41]
Abstraction for the package.xml package description file


[ Top ]


Method Detail

__construct (Constructor)   [line 69]

PEAR_PackageFile __construct( &$config, [? $debug = false], PEAR_Config $config, string 2)


Parameters:

PEAR_Config   $config   — 
?   $debug   — 
string   2   —  @tmpdir Optional temporary directory for uncompressing files
   &$config   — 

[ Top ]

addTempFile   [line 286]

void addTempFile( string $file)

Register a temporary file or directory. When the destructor is executed, all registered temporary files and directories are removed.

Parameters:

string   $file   —  name of file or directory

[ Top ]

factory   [line 123]

PEAR_PackageFile_v1|PEAR_PackageFile_v1 &factory( int $version)

Create a PEAR_PackageFile_v* of a given version.

Parameters:

int   $version   — 

[ Top ]

fromAnyFile   [line 445]

PEAR_PackageFile_v1|PEAR_PackageFile_v2 &fromAnyFile( string $info, int $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.


Parameters:

string   $info   —  file name
int   $state   —  package state (one of PEAR_VALIDATE_* constants)

[ Top ]

fromArray   [line 146]

PEAR_PackageFileManager_v1|PEAR_PackageFileManager_v2 &fromArray( array $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.


Parameters:

array   $arr   — 

[ Top ]

fromPackageFile   [line 411]

PEAR_PackageFile_v1|PEAR_PackageFile_v2 &fromPackageFile( string $descfile, int $state, [string|false $archive = false])

Create a PEAR_PackageFile_v* from a package.xml file.
  • Access: public
  • Usedby: PEAR_PackageFile::fromAnyFile() - if the file appears to be XML
  • Uses: PEAR_PackageFile::fromXmlString - to create the oject after the XML is loaded from the package.xml file.

Parameters:

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

[ Top ]

fromTgzFile   [line 301]

PEAR_PackageFile_v1|PEAR_PackageFile_v2 &fromTgzFile( string $file, int $state)

Create a PEAR_PackageFile_v* from a compressed Tar or Tgz file.

Parameters:

string   $file   —  contents of package.xml file
int   $state   —  package state (one of PEAR_VALIDATE_* constants)

[ Top ]

fromXmlString   [line 186]

PEAR_PackageFile_v1|PEAR_PackageFile_v2 &fromXmlString( string $data, int $state, string $file, [string $archive = false])

Create a PEAR_PackageFile_v* from an XML string.

Parameters:

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

[ Top ]

getClassPrefix   [line 113]

string getClassPrefix( )

For simpler unit-testing

[ Top ]

parserFactory   [line 95]

PEAR_PackageFile_Parser_v1|PEAR_PackageFile_Parser_v1 &parserFactory( int $version)

Create a PEAR_PackageFile_Parser_v* of a given version.

Parameters:

int   $version   — 

[ Top ]

rawReturn   [line 80]

void rawReturn( )

Turn off validation - return a parsed package.xml without checking it

This is used by the package-validate command


[ Top ]

setLogger   [line 85]

void setLogger( &$l)


Parameters:

   &$l   — 

[ Top ]


Documentation generated on Sun, 19 Apr 2020 14:22:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.