Home » PEAR » PEAR_PackageFileManager » Manual
Class Summary PEAR_PackageFileManager
Class Summary PEAR_PackageFileManager – PEAR :: PackageFileManager updates the <filelist></filelist> section of a PEAR package.xml file to reflect the current files in preparation for a release.
PEAR :: PackageFileManager updates the <filelist></filelist> section of a PEAR package.xml file to reflect the current files in preparation for a release.
The PEAR_PackageFileManager class uses a plugin system to generate the list of files in a package. This allows both standard recursive directory parsing (plugin type file) and more intelligent options such as the CVS browser PEAR_PackageFileManager_Cvs, which grabs all files in a local CVS checkout to create the list, ignoring any other local files.
Other options include specifying roles for file extensions (all .php files are role="php", for example), roles for directories (all directories named "tests" are given role="tests" by default), and exceptions. Exceptions are specific pathnames with * and ? wildcards that match a default role, but should have another. For example, perhaps a debug.tpl template would normally be data, but should be included in the docs role. Along these lines, to exclude files entirely, use the ignore option.
Required options for a release include version, baseinstalldir, state, and packagedirectory (the full path to the local location of the package to create a package.xml file for)
Example usage:
1 <?php
2 require_once('PEAR/PackageFileManager.php');
3 $packagexml = new
PEAR_PackageFileManager; 4 $e = $packagexml->setOptions
(
5 array('baseinstalldir' => 'PhpDocumentor',
6 'version' => '1.2.1',
7 'packagedirectory' => 'C:/Web Pages/chiara/phpdoc2/',
8 'state' => 'stable',
9 'filelistgenerator' => 'cvs', // generate from cvs, use file for directory
10 'notes' => 'We\'ve implemented many new and exciting features',
11 'ignore' => array('TODO', 'tests/'), // ignore TODO, all files in tests/
12 'installexceptions' => array('phpdoc' => '/*'), // baseinstalldir ="/" for phpdoc
13 'dir_roles' => array('tutorials' => 'doc'),
14 'exceptions' => array('README' => 'doc', // README would be data, now is doc
15 'PHPLICENSE.txt' => 'doc'))); // same for the license
16 if (PEAR::isError($e)) {
17 echo $e->getMessage();
18 die();
19 }
20 $e = $test->
addPlatformException('pear-phpdoc.bat', 'windows');
21 if (PEAR::isError($e)) {
22 echo $e->getMessage();
23 exit;
24 }
25 $packagexml->
addRole('pkg', 'doc'); // add a new role mapping
26 if (PEAR::isError($e)) {
27 echo $e->getMessage();
28 exit;
29 }
30 // replace @PHP-BIN@ in this file with the path to php executable! pretty neat
31 $e = $test->
addReplacement('pear-phpdoc', 'pear-config', '@PHP-BIN@', 'php_bin');
32 if (PEAR::isError($e)) {
33 echo $e->getMessage();
34 exit;
35 }
36 $e = $test->
addReplacement('pear-phpdoc.bat', 'pear-config', '@PHP-BIN@', 'php_bin');
37 if (PEAR::isError($e)) {
38 echo $e->getMessage();
39 exit;
40 }
41 // note use of
debugPackageFile()- this is VERY important
42 if (isset($_GET['make']) || $_SERVER['argv'][1] == 'make') {
43 $e = $packagexml->
writePackageFile();
44 } else {
45 $e = $packagexml->
debugPackageFile();
46 }
47 if (PEAR::isError($e)) {
48 echo $e->getMessage();
49 die();
50 }
51 ?>
In addition, a package.xml file can now be generated from scratch, with the usage of new options package, summary, description, and the use of the addMaintainer() method
Class Trees for PEAR_PackageFileManager
- PEAR_PackageFileManager
constructor PEAR_PackageFileManager::PEAR_PackageFileManager
constructor PEAR_PackageFileManager::PEAR_PackageFileManager() – Does nothing, use setOptions
Synopsis
require_once 'PEAR/PackageFileManager.php';
void constructor PEAR_PackageFileManager::PEAR_PackageFileManager (
)
Description
The constructor is not used in order to be able to return a PEAR_Error from setOptions
Throws
throws no exceptions thrown
See
see PEAR_PackageFileManager::setOptions()
Note
This function can not be called statically.
PEAR_PackageFileManager::addConfigureOption
PEAR_PackageFileManager::addConfigureOption() – Add an install-time configuration option for building of source
Synopsis
require_once 'PEAR/PackageFileManager.php';
void|PEAR_Error PEAR_PackageFileManager::addConfigureOption (
string $name
, string $prompt
, string $default
= null
)
Description
This option is only useful to PECL projects that are built upon installation
Parameter
-
string
$name -
name of the option
-
string
$prompt -
prompt to display to the user
-
string
$default -
default value
Throws
throws PEAR_PACKAGEFILEMANAGER_RUN_SETOPTIONS
Note
This function can not be called statically.
PEAR_PackageFileManager::addDependency
PEAR_PackageFileManager::addDependency() – Add a dependency on another package, or an extension/php
Synopsis
require_once 'PEAR/PackageFileManager.php';
void|PEAR_Error PEAR_PackageFileManager::addDependency (
string $name
, string $version
= false
, string $operator = 'ge'
, string $type = 'pkg'
, boolean $optional
= false
)
Description
This will overwrite an existing dependency if it is found. In other words, if a dependency on PHP 4.1.0 exists, and addDependency('php', '4.3.0', 'ge', 'php') is called, the existing dependency on PHP 4.1.0 will be overwritten with the new one on PHP 4.3.0
Parameter
-
string
$name -
Dependency element name
-
string
$version -
Dependency version
-
string
$operator -
A specific operator for the version, this can be one of: 'has', 'not', 'lt', 'le', 'eq', 'ne', 'ge', or 'gt'
-
string
$type -
Dependency type. This can be one of: 'pkg', 'ext', 'php', 'prog', 'os', 'sapi', or 'zend'
-
boolean
$optional -
TRUE if dependency is optional
Throws
throws PEAR_PACKAGEFILEMANAGER_RUN_SETOPTIONS
throws PEAR_PACKAGEFILEMANAGER_PHP_NOT_PACKAGE
Note
This function can not be called statically.
PEAR_PackageFileManager::addMaintainer
PEAR_PackageFileManager::addMaintainer() – Add a maintainer to the list of maintainers.
Synopsis
require_once 'PEAR/PackageFileManager.php';
void PEAR_PackageFileManager::addMaintainer (
string $handle
, lead|developer|contributor|helper $role
, string $name
, string $email
)
Description
Every maintainer must have a valid account at pear.php.net. The first parameter is the account name (for instance, cellog is the handle for Greg Beaver at pear.php.net). Every maintainer has one of four possible roles:
- lead: the primary maintainer
- developer: an important developer on the project
- contributor: self-explanatory
- helper: ditto
Finally, specify the name and email of the maintainer
Parameter
-
string
$handle -
username on pear.php.net of maintainer
-
lead|developer|contributor|helper
$role -
role of maintainer
-
string
$name -
full name of maintainer
-
string
$email -
email address of maintainer
Throws
throws no exceptions thrown
Note
This function can not be called statically.
PEAR_PackageFileManager::addPlatformException
PEAR_PackageFileManager::addPlatformException() – Add an install-time platform conditional install for a file
Synopsis
require_once 'PEAR/PackageFileManager.php';
void PEAR_PackageFileManager::addPlatformException (
string $path
, string $platform
)
Description
The format of the platform string must be OS-version-cpu-extra if any more specific information is needed, and the OS must be in lower case as in "windows." The match is performed using a regular expression, but uses * and ? wildcards instead of .* and .?. Note that hpux/aix/irix/linux are all exclusive. To select non-windows, use an expression like (*ix|*ux|darwin). If using PEAR 1.3.2 and newer, use !windows.
This information is based on eyeing the source for OS/Guess.php, so if you are unsure of what to do, read that file.
Parameter
-
string
$path -
relative path of file (relative to packagedirectory option)
-
string
$platform -
platform descriptor string
Throws
throws no exceptions thrown
Note
This function can not be called statically.
PEAR_PackageFileManager::addGlobalReplacement
PEAR_PackageFileManager::addGlobalReplacement() – Add a replacement option for all files
Synopsis
require_once 'PEAR/PackageFileManager.php';
void PEAR_PackageFileManager::addglobalreplacement (
string $type
, string $from
, string $to
)
Description
This sets an install-time complex search-and-replace function allowing the setting of platform-specific variables in all installed files.
if $type is php-const, then $to must be the name of a PHP Constant. If $type is pear-config, then $to must be the name of a PEAR config variable accessible through a PEAR_Config::get() method. If type is package-info, then $to must be the name of a section from the package.xml file used to install this file.
Parameter
-
string
$type -
variable type, either php-const, pear-config or package-info
-
string
$from -
text to replace in the source file
-
string
$to -
variable name to use for replacement
Throws
throws PEAR_PACKAGEFILEMANAGER_INVALID_REPLACETYPE
Note
This function can not be called statically.
PEAR_PackageFileManager::addReplacement
PEAR_PackageFileManager::addReplacement() – Add a replacement option for a file
Synopsis
require_once 'PEAR/PackageFileManager.php';
void PEAR_PackageFileManager::addReplacement (
string $path
, string $type
, string $from
, string $to
)
Description
This sets an install-time complex search-and-replace function allowing the setting of platform-specific variables in an installed file.
if $type is php-const, then $to must be the name of a PHP Constant. If $type is pear-config, then $to must be the name of a PEAR config variable accessible through a PEAR_Config::get() method. If type is package-info, then $to must be the name of a section from the package.xml file used to install this file.
Parameter
-
string
$path -
relative path of file (relative to packagedirectory option)
-
string
$type -
variable type, either php-const, pear-config or package-info
-
string
$from -
text to replace in the source file
-
string
$to -
variable name to use for replacement
Throws
throws PEAR_PACKAGEFILEMANAGER_INVALID_REPLACETYPE
Note
This function can not be called statically.
PEAR_PackageFileManager::addRole
PEAR_PackageFileManager::addRole() – Add an extension/role mapping to the role mapping option
Synopsis
require_once 'PEAR/PackageFileManager.php';
void PEAR_PackageFileManager::addRole (
string $extension
, string $role
)
Description
Roles influence both where a file is installed and how it is installed. Files with role="data" are in a completely different directory hierarchy from the program files of role="php"
In PEAR 1.3b2, these roles are
- php (most common)
- data
- doc
- test
- script (gives the file an executable attribute)
- src
Parameter
-
string
$extension -
file extension
-
string
$role -
role
Throws
throws PEAR_PACKAGEFILEMANAGER_INVALID_ROLE
Note
This function can not be called statically.
PEAR_PackageFileManager::detectDependencies
PEAR_PackageFileManager::detectDependencies() – use PHP_CompatInfo to auto-detect PHP and extension dependencies.
Synopsis
require_once 'PEAR/PackageFileManager.php';
void|PEAR_Error PEAR_PackageFileManager::detectDependencies (
)
Description
Use addDependency() to add package dependencies
Throws
throws PEAR_PACKAGEFILEMANAGER_RUN_SETOPTIONS
throws PEAR_PACKAGEFILEMANAGER_PHP_COMPAT_NOT_INSTALLED
throws PEAR_PACKAGEFILEMANAGER_NO_PHPCOMPATINFO
See
see PEAR_PackageFileManager::addDependency()
Note
This function can not be called statically.
PEAR_PackageFileManager::debugPackageFile
PEAR_PackageFileManager::debugPackageFile() – ALWAYS use this to test output before overwriting your package.xml!!
Synopsis
require_once 'PEAR/PackageFileManager.php';
void PEAR_PackageFileManager::debugPackageFile (
)
Description
This method instructs writePackageFile() to simply print the package.xml to output, either command-line or web-friendly (this is automatic based on the existence of $_SERVER['PATH_TRANSLATED']
Throws
throws no exceptions thrown
See
see PEAR_PackageFileManager::writePackageFile() - calls with the debug parameter set based on whether it is called from the command-line or web interface
Note
This function can not be called statically.
PEAR_PackageFileManager::getWarnings
PEAR_PackageFileManager::getWarnings() – Retrieve the list of warnings
Synopsis
require_once 'PEAR/PackageFileManager.php';
array PEAR_PackageFileManager::getWarnings (
)
Description
This package is not documented yet.
Throws
throws no exceptions thrown
Note
This function can not be called statically.
PEAR_PackageFileManager::isIncludeable
PEAR_PackageFileManager::isIncludeable() – calls http://www.php.net/file_exists for each value in include_path,
Synopsis
require_once 'PEAR/PackageFileManager.php';
boolean PEAR_PackageFileManager::isIncludeable (
string $filename
)
Description
then calls http://www.php.net/is_readable when it finds the file
Parameter
-
string
$filename
Throws
throws no exceptions thrown
static
static
Note
This function can not be called statically.
PEAR_PackageFileManager::pushWarning
PEAR_PackageFileManager::pushWarning() – Store a warning on the warning stack
Synopsis
require_once 'PEAR/PackageFileManager.php';
void PEAR_PackageFileManager::pushWarning (
mixed $code
, mixed $info
)
Description
This package is not documented yet.
Parameter
-
mixed
$code
-
mixed
$info
Throws
throws no exceptions thrown
Note
This function can not be called statically.
PEAR_PackageFileManager::raiseError
PEAR_PackageFileManager::raiseError() – Utility function to shorten error generation code
Synopsis
require_once 'PEAR/PackageFileManager.php';
PEAR_Error PEAR_PackageFileManager::raiseError (
mixed $code
, mixed $i1 = ''
, mixed $i2 = ''
)
Description
1 functionraiseError
($code, $i1 = '', $i2 = '')
2 {
3 return PEAR::raiseError('PEAR_PackageFileManager Error: ' .
4
sprintf($GLOBALS['_PEAR_PACKAGEFILEMANAGER_ERRORS'][$this->_options['lang']][$code], 5 $i1, $i2), $code); 6 }
Parameter
-
mixed
$code
-
mixed
$i1
-
mixed
$i2
Throws
throws no exceptions thrown
static
static
Note
This function can not be called statically.
PEAR_PackageFileManager::setOptions
PEAR_PackageFileManager::setOptions() – Set package.xml generation options
Synopsis
require_once 'PEAR/PackageFileManager.php';
void|PEAR_Error PEAR_PackageFileManager::setOptions (
array $options = array()
)
Description
The options array is indexed as follows:
1 $options = array('option_name' => <optionvalue>);
The documentation below simplifies this description through the use of option_name without quotes
Configuration options:
- lang: lang controls the language in which error messages are displayed. There are currently only English error messages, but any contributed will be added over time. Possible values: en (default)
- packagefile: the name of the packagefile, defaults to package.xml
- pathtopackagefile: the path to an existing package file to read in, if different from the packagedirectory
- packagedirectory: the path to the base directory of the package. For package PEAR_PackageFileManager, this path is /path/to/pearcvs/pear/PEAR_PackageFileManager where /path/to/pearcvs is a local path on your hard drive
- outputdirectory: the path in which to place the generated package.xml by default, this is ignored, and the package.xml is created in the packagedirectory
- filelistgenerator: the <filelist> section plugin which will be used. In this release, there are two generator plugins, file and cvs. For details, see the docs for these plugins
- usergeneratordir: For advanced users. If you write your own filelist generator plugin, use this option to tell PEAR_PackageFileManager where to find the file that contains it. If the plugin is named foo, the class must be named PEAR_PackageFileManager_Foo no matter where it is located. By default, the Foo plugin is located in PEAR/PackageFileManager/Foo.php. If you pass /path/to/foo in this option, setOptions will look for PEAR_PackageFileManager_Foo in /path/to/foo/Foo.php
- doctype: Specifies the DTD of the package.xml file. Default is http://pear.php.net/dtd/package-1.0
- pearcommonclass: Specifies the name of the class to instantiate, default is PEAR_Common, but users can override this with a custom class that implements PEAR_Common's method interface
- changelogoldtonew: True if the ChangeLog should list from oldest entry to newest. Set to false if you would like new entries first
- simpleoutput: True if the package.xml should not contain md5sum or <provides /> for readability
- addhiddenfiles: True if you wish to add hidden files/directories that begin with . like .bashrc. This is only used by the File generator. The CVS generator will use all files in CVS regardless of format
package.xml simple options:
- baseinstalldir: The base directory to install this package in. For package PEAR_PackageFileManager, this is "PEAR", for package PEAR, this is "/"
- license: The license this release is released under. Default is PHP License if left unspecified
- notes: Release notes, any text describing what makes this release unique
- changelognotes: notes for the changelog, this should be more detailed than the release notes. By default, PEAR_PackageFileManager uses the notes option for the changelog as well
- version: The version number for this release. Remember the convention for numbering: initial alpha is between 0 and 1, add b<beta number> for beta as in 1.0b1, the integer portion of the version should specify backwards compatibility, as in 1.1 is backwards compatible with 1.0, but 2.0 is not backwards compatible with 1.10. Also note that 1.10 is a greater release version than 1.1 (think of it as "one point ten" and "one point one"). Bugfix releases should be a third decimal as in 1.0.1, 1.0.2
- package: [optional] Package name. Use this to create a new package.xml, or overwrite an existing one from another package used as a template
- summary: [optional] Summary of package purpose
- description: [optional] Description of package purpose. Note that the above three options are not optional when creating a new package.xml from scratch
WARNING: all complex options that require a file path are case-sensitive
package.xml complex options:
- cleardependencies: since version 1.3.0, this option will erase any existing dependencies in the package.xml if set to true
- ignore: an array of filenames, directory names, or wildcard expressions specifying files to exclude entirely from the package.xml. Wildcards are operating system wildcards * and ?. file*foo.php will exclude filefoo.php, fileabrfoo.php and filewho_is_thisfoo.php. file?foo.php will exclude fileafoo.php and will not exclude fileaafoo.php. test/ will exclude all directories and subdirectories of ANY directory named test encountered in directory parsing. *test* will exclude all files and directories that contain test in their name
- include: an array of filenames, directory names, or wildcard expressions specifying files to include in the listing. All other files will be ignored. Wildcards are in the same format as ignore
- roles: this is an array mapping file extension to install role. This specifies default behavior that can be overridden by the exceptions option and dir_roles option. use addRole() to add a new role to the pre-existing array
- dir_roles: this is an array mapping directory name to install role. All files in a directory whose name matches the directory will be given the install role specified. Single files can be excluded from this using the exceptions option. The directory should be a relative path from the baseinstalldir, or "/" for the baseinstalldir
- exceptions: specify file role for specific files. This array maps all files matching the exact name of a file to a role as in "file.ext" => "role"
- deps: dependency array. Pass in an empty array to clear all dependencies, and use addDependency() to add new ones/replace existing ones
- maintainers: maintainers array. Pass in an empty array to clear all maintainers, and use addMaintainer() to add a new maintainer/replace existing maintainer
- installexceptions: array mapping of specific filenames to baseinstalldir values. Use this to force the installation of a file into another directory, such as forcing a script to be in the root scripts directory so that it will be in the path. The filename must be a relative path to the packagedirectory
- platformexceptions: array mapping of specific filenames to the platform they should be installed on. Use this to specify unix-only files or windows-only files. The format of the platform string must be OS-version-cpu-extra if any more specific information is needed, and the OS must be in lower case as in "windows." The match is performed using a regular expression, but uses * and ? wildcards instead of .* and .?. Note that hpux/aix/irix/linux are all exclusive. To select non-windows, use (*ix|*ux)
- scriptphaseexceptions: array mapping of scripts to their install phase. This can be one of: pre-install, post-install, pre-uninstall, post-uninstall, pre-build, post-build, pre-setup, or post-setup
- installas: array mapping of specific filenames to the filename they should be installed as. Use this to specify new filenames for files that should be installed. This will often be used in conjunction with platformexceptions if there are two files for different OSes that must have the same name when installed.
- replacements: array mapping of specific filenames to complex text search-and-replace that
should be performed upon install. The format is:
filename => array('type' => php-const|pear-config|package-info
'from' => text in file
'to' => name of variable) if type is php-const, then 'to' must be the name of a PHP Constant. If type is pear-config, then 'to' must be the name of a PEAR config variable accessible through a PEAR_Config class->get() method. If type is package-info, then 'to' must be the name of a section from the package.xml file used to install this file. - globalreplacements: a list of replacements that should be performed on every single file. The format is the same as replacements (since 1.4.0)
- configure_options: array specifies build options for PECL packages (you should probably use PECL_Gen instead, but it's here for completeness)
Parameter
-
array
$options
Throws
throws PEAR_PACKAGEFILEMANAGER_NOPKGDIR
throws PEAR_PACKAGEFILEMANAGER_NOVERSION
throws PEAR_PACKAGEFILEMANAGER_NOSTATE
throws PEAR_PACKAGEFILEMANAGER_NOBASEDIR
throws PEAR_PACKAGEFILEMANAGER_GENERATOR_NOTFOUND_ANYWHERE
throws PEAR_PACKAGEFILEMANAGER_GENERATOR_NOTFOUND
See
see PEAR_PackageFileManager_CVS
see PEAR_PackageFileManager_File
Note
This function can not be called statically.
PEAR_PackageFileManager::writePackageFile
PEAR_PackageFileManager::writePackageFile() – Writes the package.xml file out with the newly created <release></release> tag
Synopsis
require_once 'PEAR/PackageFileManager.php';
void|PEAR_Error PEAR_PackageFileManager::writePackageFile (
boolean $debuginterface
= null
)
Description
ALWAYS use debugPackageFile() to verify that output is correct before overwriting your package.xml
Parameter
-
boolean
$debuginterface -
NULL if no debugging, TRUE if web interface, FALSE if command-line
Throws
throws PEAR_PACKAGEFILEMANAGER_RUN_SETOPTIONS
throws PEAR_PACKAGEFILEMANAGER_ADD_MAINTAINERS
throws PEAR_PACKAGEFILEMANAGER_CANTWRITE_PKGFILE
throws PEAR_PACKAGEFILEMANAGER_CANTOPEN_TMPPKGFILE
throws PEAR_PACKAGEFILEMANAGER_CANTCOPY_PKGFILE
throws PEAR_PACKAGEFILEMANAGER_DEST_UNWRITABLE
See
see PEAR_PackageFileManager::debugPackageFile() - calls with the debug parameter set based on whether it is called from the command-line or web interface
Note
This function can not be called statically.
Class Summary PEAR_PackageFileManager_CVS
Class Summary PEAR_PackageFileManager_CVS – Generate a file list from a CVS checkout
Generate a file list from a CVS checkout
Note that this will NOT work on a repository, only on a checked out CVS module
Class Trees for PEAR_PackageFileManager_CVS
-
PEAR_PackageFileManager_File
- PEAR_PackageFileManager_CVS
PEAR_PackageFileManager_CVS Inherited Methods
| Method Name | Summary |
|---|---|
| Constructor PEAR_PackageFileManager_File::PEAR_PackageFileManager_File() | Set up the File filelist generator |
| PEAR_PackageFileManager_File::dirList() | Retrieve a listing of every file in $directory and all subdirectories. |
| PEAR_PackageFileManager_File::getFileList() | Generate the <filelist></filelist> section of the package file. |
PEAR_PackageFileManager_CVS::dirList
PEAR_PackageFileManager_CVS::dirList() – Return a list of all files in the CVS repository
Synopsis
require_once 'PEAR/PackageFileManager/Cvs.php';
array PEAR_PackageFileManager_CVS::dirList (
string $directory
)
Description
This function is like parent::dirList() except that instead of retrieving a regular filelist, it first retrieves a listing of all the CVS/Entries files in $directory and all of the subdirectories. Then, it reads the Entries file, and creates a listing of files that are a part of the CVS repository. No check is made to see if they have been modified, but newly added or removed files are ignored.
Parameter
-
string
$directory -
full path to the directory you want the list of
Return value
returns list of files in a directory
Throws
throws no exceptions thrown
See
see _readCVSEntries()
see _recurDirList()
Note
This function can not be called statically.
Class Summary PEAR_PackageFileManager_File
Class Summary PEAR_PackageFileManager_File – Retrieve the files from a directory listing
Retrieve the files from a directory listing
This class is used to retrieve a raw directory listing. Use the PEAR_PackageFileManager_CVS class to only retrieve the contents of a cvs repository when generating the package.xml
Class Trees for PEAR_PackageFileManager_File
- PEAR_PackageFileManager_File
| Class | Summary |
|---|---|
| PEAR_PackageFileManager_CVS | Generate a file list from a CVS checkout |
constructor PEAR_PackageFileManager_File::PEAR_PackageFileManager_File
constructor PEAR_PackageFileManager_File::PEAR_PackageFileManager_File() – Set up the File filelist generator
Synopsis
require_once 'PEAR/PackageFileManager/File.php';
void constructor PEAR_PackageFileManager_File::PEAR_PackageFileManager_File (
PEAR_PackageFileManager &$parent
, array $options
)
Description
'ignore' and 'include' are the only options that this class uses. See PEAR_PackageFileManager::setOptions() for more information and formatting of this option
Parameter
-
PEAR_PackageFileManager
&$parent
-
array
$options
Throws
throws no exceptions thrown
Note
This function can not be called statically.
PEAR_PackageFileManager_File::dirList
PEAR_PackageFileManager_File::dirList() – Retrieve a listing of every file in $directory and all subdirectories.
Synopsis
require_once 'PEAR/PackageFileManager/File.php';
array PEAR_PackageFileManager_File::dirList (
string $directory
)
Description
The return format is an array of full paths to files
Parameter
-
string
$directory -
full path to the directory you want the list of
Return value
returns list of files in a directory
Throws
throws PEAR_PACKAGEFILEMANAGER_DIR_DOESNT_EXIST
Note
This function can not be called statically.
PEAR_PackageFileManager_File::getFileList
PEAR_PackageFileManager_File::getFileList() – Generate the <filelist></filelist> section of the package file.
Synopsis
require_once 'PEAR/PackageFileManager/File.php';
array PEAR_PackageFileManager_File::getFileList (
)
Description
This function performs the backend generation of the array containing all files in this package
Throws
throws no exceptions thrown
Note
This function can not be called statically.
Class Summary PEAR_PackageFileManager_XMLOutput
Class Summary PEAR_PackageFileManager_XMLOutput – Class for XML output
Class for XML output
This package is not documented yet.
Class Trees for PEAR_PackageFileManager_XMLOutput
-
PEAR_Common
- PEAR_PackageFileManager_XMLOutput
Package PEAR_PackageFileManager Constants
Package PEAR_PackageFileManager Constants – Constants defined in and used by PEAR_PackageFileManager
All Constants
Constants defined in PackageFileManager.php
| Name | Value | Line Number |
|---|---|---|
| PEAR_PACKAGEFILEMANAGER_ADD_MAINTAINERS | 19 | 50 |
| PEAR_PACKAGEFILEMANAGER_CANTCOPY_PKGFILE | 9 | 40 |
| PEAR_PACKAGEFILEMANAGER_CANTOPEN_TMPPKGFILE | 10 | 41 |
| PEAR_PACKAGEFILEMANAGER_CANTWRITE_PKGFILE | 7 | 38 |
| PEAR_PACKAGEFILEMANAGER_CVS_PACKAGED | 26 | 57 |
| PEAR_PACKAGEFILEMANAGER_DEST_UNWRITABLE | 8 | 39 |
| PEAR_PACKAGEFILEMANAGER_DIR_DOESNT_EXIST | 13 | 44 |
| PEAR_PACKAGEFILEMANAGER_GENERATOR_NOTFOUND | 5 | 36 |
| PEAR_PACKAGEFILEMANAGER_GENERATOR_NOTFOUND_ANYWHERE | 6 | 37 |
| PEAR_PACKAGEFILEMANAGER_IGNORED_EVERYTHING | 21 | 52 |
| PEAR_PACKAGEFILEMANAGER_INVALID_PACKAGE | 22 | 53 |
| PEAR_PACKAGEFILEMANAGER_INVALID_REPLACETYPE | 23 | 54 |
| PEAR_PACKAGEFILEMANAGER_INVALID_ROLE | 24 | 55 |
| PEAR_PACKAGEFILEMANAGER_NOBASEDIR | 4 | 35 |
| PEAR_PACKAGEFILEMANAGER_NOCVSENTRIES | 12 | 43 |
| PEAR_PACKAGEFILEMANAGER_NODESC | 18 | 49 |
| PEAR_PACKAGEFILEMANAGER_NOPACKAGE | 15 | 46 |
| PEAR_PACKAGEFILEMANAGER_NOPKGDIR | 3 | 34 |
| PEAR_PACKAGEFILEMANAGER_NOSTATE | 1 | 32 |
| PEAR_PACKAGEFILEMANAGER_NOSUMMARY | 17 | 48 |
| PEAR_PACKAGEFILEMANAGER_NOVERSION | 2 | 33 |
| PEAR_PACKAGEFILEMANAGER_NO_FILES | 20 | 51 |
| PEAR_PACKAGEFILEMANAGER_PATH_DOESNT_EXIST | 11 | 42 |
| PEAR_PACKAGEFILEMANAGER_PHP_NOT_PACKAGE | 25 | 56 |
| PEAR_PACKAGEFILEMANAGER_RUN_SETOPTIONS | 14 | 45 |
| PEAR_PACKAGEFILEMANAGER_WRONG_MROLE | 16 | 47 |
Package PEAR_PackageFileManager Global Variables
Package PEAR_PackageFileManager Global Variables – Global Variables defined in and used by PEAR_PackageFileManager
All Global Variables
Global Variables defined in PackageFileManager.php
| Name | Value | Line Number |
|---|---|---|
| $GLOBALS['_PEAR_PACKAGEFILEMANAGER_ERRORS'] | 1 array( 2 'en' => 3 array( 4PEAR_PACKAGEFILEMANAGER_NOSTATE => 5 'Release State (option \'state\') must by specified in PEAR_PackageFileManager setOptions (alpha|beta|stable)', 6PEAR_PACKAGEFILEMANAGER_NOVERSION => 7 'Release Version (option \'version\') must be specified in PEAR_PackageFileManager setOptions', 8PEAR_PACKAGEFILEMANAGER_NOPKGDIR => 9 'Package source base directory (option \'packagedirectory\') must be ' . 10 'specified in PEAR_PackageFileManager setOptions', 11PEAR_PACKAGEFILEMANAGER_NOBASEDIR => 12 'Package install base directory (option \'baseinstalldir\') must be ' . 13 'specified in PEAR_PackageFileManager setOptions', 14PEAR_PACKAGEFILEMANAGER_GENERATOR_NOTFOUND => 15 'Base class "%s" can\'t be located', 16PEAR_PACKAGEFILEMANAGER_GENERATOR_NOTFOUND_ANYWHERE => 17 'Base class "%s" can\'t be located in default or user-specified directories', 18PEAR_PACKAGEFILEMANAGER_CANTWRITE_PKGFILE => 19 'Failed to write package.xml file to destination directory', 20PEAR_PACKAGEFILEMANAGER_DEST_UNWRITABLE => 21 'Destination directory "%s" is unwritable', 22PEAR_PACKAGEFILEMANAGER_CANTCOPY_PKGFILE => 23 'Failed to copy package.xml.tmp file to package.xml', 24PEAR_PACKAGEFILEMANAGER_CANTOPEN_TMPPKGFILE => 25 'Failed to open temporary file "%s" for writing', 26PEAR_PACKAGEFILEMANAGER_PATH_DOESNT_EXIST => 27 'package.xml file path "%s" doesn\'t exist or isn\'t a directory', 28PEAR_PACKAGEFILEMANAGER_NOCVSENTRIES => 29 'Directory "%s" is not a CVS directory (it must have the CVS/Entries file)', 30PEAR_PACKAGEFILEMANAGER_DIR_DOESNT_EXIST => 31 'Package source base directory "%s" doesn\'t exist or isn\'t a directory', 32PEAR_PACKAGEFILEMANAGER_RUN_SETOPTIONS => 33 'Run $managerclass->setOptions() before any other methods', 34PEAR_PACKAGEFILEMANAGER_NOPACKAGE => 35 'Package Name (option \'package\') must by specified in PEAR_PackageFileManager '. 36 'setOptions to create a new package.xml', 37PEAR_PACKAGEFILEMANAGER_NOSUMMARY => 38 'Package Summary (option \'summary\') must by specified in PEAR_PackageFileManager' . 39 ' setOptions to create a new package.xml', 40PEAR_PACKAGEFILEMANAGER_NODESC => 41 'Detailed Package Description (option \'description\') must be' . 42 ' specified in PEAR_PackageFileManager setOptions to create a new package.xml', 43PEAR_PACKAGEFILEMANAGER_WRONG_MROLE => 44 'Maintainer role must be one of "%s", was "%s"', 45PEAR_PACKAGEFILEMANAGER_ADD_MAINTAINERS => 46 'Add maintainers to a package before generating the package.xml', 47PEAR_PACKAGEFILEMANAGER_NO_FILES => 48 'No files found, check the path "%s"', 49PEAR_PACKAGEFILEMANAGER_IGNORED_EVERYTHING => 50 'No files left, check the path "%s" and ignore option "%s"', 51PEAR_PACKAGEFILEMANAGER_INVALID_PACKAGE => 52 'Package validation failed:%s%s', 53PEAR_PACKAGEFILEMANAGER_INVALID_REPLACETYPE => 54 'Replacement Type must be one of "%s", was passed "%s"', 55PEAR_PACKAGEFILEMANAGER_INVALID_ROLE => 56 'Invalid file role passed to addRole, must be one of "%s", was passed "%s"', 57PEAR_PACKAGEFILEMANAGER_PHP_NOT_PACKAGE => 58 'addDependency had PHP as a package, use type="php"', 59PEAR_PACKAGEFILEMANAGER_CVS_PACKAGED => 60 'path "%path%" contains CVS directory', 61 ),) |
63 |