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

Class: PEAR_PackageFile

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

Class Overview


Abstraction for the package.xml package description file


Author(s):

Version:

  • Release: 1.9.5

Copyright:

  • 1997-2009 The Authors

Methods


Inherited Variables

Inherited Methods


Class Details

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


[ Top ]


Method Detail

PEAR_PackageFile (Constructor)   [line 70]

PEAR_PackageFile PEAR_PackageFile( &$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 287]

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

PEAR_PackageFile_v1|PEAR_PackageFile_v1 &factory( int $version)

Create a PEAR_PackageFile_v* of a given version.

Parameters:

int   $version     

[ Top ]

fromAnyFile   [line 446]

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

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

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

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

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

string getClassPrefix( )

For simpler unit-testing

[ Top ]

parserFactory   [line 96]

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

void rawReturn( )

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

This is used by the package-validate command


[ Top ]

setLogger   [line 86]

void setLogger( &$l)


Parameters:

   &$l     

[ Top ]


Documentation generated on Sat, 12 Jul 2014 14:00:58 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.