PEAR_PackageFileManager::setOptions
Вернуться к: PEAR_PackageFileManager
PEAR_PackageFileManager::setOptions
Synopsis
void|PEAR_Error PEAR_PackageFileManager::setOptions ( array $options = array() )
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
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
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
Note
This function can not be called statically.
Вернуться к: PEAR_PackageFileManager