[ Index ]
 

Code source de PHP PEAR 1.4.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/PEAR/PackageFile/Generator/ -> v1.php (sommaire)

package.xml generation class, package.xml version 1.0 PHP versions 4 and 5

Author: Greg Beaver <cellog@php.net>
Copyright: 1997-2006 The PHP Group
License: http://www.php.net/license/3_0.txt PHP License 3.0
Version: CVS: $Id: v1.php,v 1.72 2006/05/10 02:56:19 cellog Exp $
Poids: 1272 lignes (51 kb)
Inclus ou requis: 3 fois
Référencé: 1 fois
Nécessite: 4 fichiers
 System.php
 Archive/Tar.php
 PEAR/Validate.php
 PEAR/PackageFile/v2.php

Définit 1 class

PEAR_PackageFile_Generator_v1:: (20 méthodes):
  PEAR_PackageFile_Generator_v1()
  getPackagerVersion()
  toTgz()
  toPackageFile()
  _fixXmlEncoding()
  toXml()
  _makeReleaseXml()
  recursiveXmlFilelist()
  _addDir()
  _formatDir()
  _formatFile()
  _unIndent()
  dependenciesToV2()
  toV2()
  _convertDependencies2_0()
  _convertFilelist2_0()
  _convertRelease2_0()
  _processDep()
  _processPhpDeps()
  _processMultipleDepsName()


Classe: PEAR_PackageFile_Generator_v1  - X-Ref

This class converts a PEAR_PackageFile_v1 object into any output format.

Supported output formats include array, XML string, and a PEAR_PackageFile_v2
object, for converting package.xml 1.0 into package.xml 2.0 with no sweat.
PEAR_PackageFile_Generator_v1(&$packagefile)   X-Ref


getPackagerVersion()   X-Ref
Pas de description

toTgz(&$packager, $compress = true, $where = null)   X-Ref

param: PEAR_Packager
param: bool if true, a .tgz is written, otherwise a .tar is written
param: string|null directory in which to save the .tgz
return: string|PEAR_Error location of package or error object

toPackageFile($where = null, $state = PEAR_VALIDATE_NORMAL, $name = 'package.xml',$nofilechecking = false)   X-Ref

param: string|null directory to place the package.xml in, or null for a temporary dir
param: int one of the PEAR_VALIDATE_* constants
param: string name of the generated file
param: bool if true, then no analysis will be performed on role="php" files
return: string|PEAR_Error path to the created file on success

_fixXmlEncoding($string)   X-Ref
fix both XML encoding to be UTF8, and replace standard XML entities < > " & '

param: string $string
return: string

toXml($state = PEAR_VALIDATE_NORMAL, $nofilevalidation = false)   X-Ref
Return an XML document based on the package info (as returned
by the PEAR_Common::infoFrom* methods).

return: string XML data

_makeReleaseXml($pkginfo, $changelog = false, $state = PEAR_VALIDATE_NORMAL)   X-Ref
Generate part of an XML description with release information.

param: array  $pkginfo    array with release information
param: bool   $changelog  whether the result will be in a changelog element
return: string XML data

recursiveXmlFilelist($list)   X-Ref

param: array

_addDir(&$dirs, $dir, $file = null, $attributes = null)   X-Ref

param: array
param: array
param: string|null
param: array|null

_formatDir($dirs, $indent = '', $curdir = '')   X-Ref

param: array
param: string
param: string

_formatFile($file, $attributes, $indent)   X-Ref

param: string
param: array
param: string

_unIndent($str)   X-Ref
Unindent given string (?)

param: string $str The string that has to be unindented.
return: string

dependenciesToV2()   X-Ref

return: array

toV2($class = 'PEAR_PackageFile_v2', $strict = false)   X-Ref
Convert a package.xml version 1.0 into version 2.0

Note that this does a basic conversion, to allow more advanced
features like bundles and multiple releases
param: string the classname to instantiate and return.  This must be
param: boolean if true, only valid, deterministic package.xml 1.0 as defined by the
return: PEAR_PackageFile_v2|PEAR_Error

_convertDependencies2_0(&$release, $internal = false)   X-Ref

param: array
param: bool

_convertFilelist2_0(&$package)   X-Ref

param: array

_convertRelease2_0(&$release, $package)   X-Ref
Post-process special files with install-as/platform attributes and
make the release tag.

This complex method follows this work-flow to create the release tags:

<pre>
- if any install-as/platform exist, create a generic release and fill it with
o <install as=..> tags for <file name=... install-as=...>
o <install as=..> tags for <file name=... platform=!... install-as=..>
o <ignore> tags for <file name=... platform=...>
o <ignore> tags for <file name=... platform=... install-as=..>
- create a release for each platform encountered and fill with
o <install as..> tags for <file name=... install-as=...>
o <install as..> tags for <file name=... platform=this platform install-as=..>
o <install as..> tags for <file name=... platform=!other platform install-as=..>
o <ignore> tags for <file name=... platform=!this platform>
o <ignore> tags for <file name=... platform=other platform>
o <ignore> tags for <file name=... platform=other platform install-as=..>
o <ignore> tags for <file name=... platform=!this platform install-as=..>
</pre>

It does this by accessing the $package parameter, which contains an array with
indices:

- platform: mapping of file => OS the file should be installed on
- install-as: mapping of file => installed name
- osmap: mapping of OS => list of files that should be installed
on that OS
- notosmap: mapping of OS => list of files that should not be
installed on that OS

param: array
param: array

_processDep($dep)   X-Ref

param: array
return: array

_processPhpDeps($deps)   X-Ref

param: array
return: array

_processMultipleDepsName($deps)   X-Ref
process multiple dependencies that have a name, like package deps

param: array
return: array



Généré le : Sun Feb 25 14:08:00 2007 par Balluche grâce à PHPXref 0.7