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

Class: PEAR_PackageFile

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

Class Overview


Abstraction for the package.xml package description file


Author(s):

Version:

  • Release: 1.7.2

Copyright:

  • 1997-2008 The PHP Group

Methods


Inherited Variables

Inherited Methods


Class Details

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


[ Top ]


Method Detail

PEAR_PackageFile (Constructor)   [line 73]

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


Parameters:

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

[ Top ]

addTempFile   [line 280]

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 127]

PEAR_PackageFile_v1|PEAR_PackageFile_v1 &factory( int $version)

Create a PEAR_PackageFile_v* of a given version.

Parameters:

int   $version   — 

[ Top ]

fromAnyFile   [line 431]

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 149]

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 400]

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 295]

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

Create a PEAR_PackageFile_v* from a compresed 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 117]

string getClassPrefix( )

For simpler unit-testing

[ Top ]

parserFactory   [line 100]

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 85]

void rawReturn( )

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

This is used by the package-validate command


[ Top ]

setLogger   [line 90]

void setLogger( &$l)


Parameters:

   &$l   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:21:49 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.