PHP Class Package2XmlToComposer, horde

Elements not typically found in package.xml files can be set (or overridden) using methods or a config JSON file. Yes, some of this capability is present in Composer itself, given Composer's ability to install PEAR packages. However, Composer relies on PEAR channels, meaning using Composer's classes for this capability would require developers supporting PEAR and Composer to first publish their packages to their channel and then generate composer.json files afterwards. Using this class, and in particular, the package2composer script that leverages this class, developers are able to use the package.xml file they're using with PEAR's package command to generate a composer.json, which allows a one-stage release workflow to be scripted.
Afficher le fichier Open project: horde/horde Class Usage Examples

Méthodes publiques

Свойство Type Description
$output_file

Protected Properties

Свойство Type Description
$autoload
$bin_files
$branch_alias
$config
$data
$dependency_map
$extra
$extra_suggestions
$homepage
$include_path
$keywords
$license
$name
$package2file_path
$repositories * Horde
$support
$type
$write_time_to_composer
$write_version_to_composer
$xml

Méthodes publiques

Méthode Description
__construct ( $package2file, $config = null )
convert ( $output_file = null )
getParsedPackageData ( ) : array Allow retrieval of parsed data structure.
help ( ) Help output for CLI version
main ( ) Main method that starts conversion from the command-line
outputTo ( string $output_path ) Allow setting of the output path location
setAutoload ( array $config ) : self Set up any autoload configuration necessary
setBinFiles ( array $files ) : self Set bin-files list
setBranchAlias ( $aliases ) : self Set up any branch-alias that may be specified
setDependencyMap ( array $map ) : self Set a name mapping to dependencies. Naming conventions can vary between PEAR-style and composer/github style.
setExtra ( $extra ) : self Set the entire 'extra' array
setExtraSuggestions ( array $suggestions ) : self Set extra suggestions for features, beyond what is mentioned in package.xml
setHomepage ( string $homepage ) : self Set homepage to use in composer.json. Defaults to channel if not set.
setIncludePath ( array $list ) : self If you must, set up any include paths, relative to vendor dir
setKeywords ( array $keywords ) : self Set keywords which will be picked up by Packagist and/or other package search tools.
setLicense ( $license ) : self Set SPDX license string. If omitted, license value from package.xml will be used.
setName ( string $name ) : self Set the name of the package to put in composer.json
setRepositories ( $repos ) * Horde
setSupportInfo ( $support ) : self Set keywords which will be picked up by Packagist and/or other package search tools.
setType ( $type ) : self Set the type of composer package. Defaults to 'library'
writeTimeToComposer ( $bool ) : self Should release date/time information from package.xml be written to composer.json?
writeVersionToComposer ( $bool ) : self Should version information from package.xml be written to composer.json?

Méthodes protégées

Méthode Description
applyConfig ( ) Apply values provided in a config JSON file.
getChannelSuggestedAlias ( $channel )
getDepVersionString ( $req )

Method Details

__construct() public méthode

public __construct ( $package2file, $config = null )

applyConfig() protected méthode

Recognized values in JSON configuration: keywords license homepage dependency_map support autoload include_path bin Non-composer.json-standard values: dependency_map: dependency_map allows mapping of PEAR package dependencies to their composer equivalents. output_path: Allows setting where composer.json should be written. Default is to write it in the same directory as package.xml
protected applyConfig ( )

convert() public méthode

public convert ( $output_file = null )

getChannelSuggestedAlias() protected méthode

protected getChannelSuggestedAlias ( $channel )

getDepVersionString() protected méthode

protected getDepVersionString ( $req )

getParsedPackageData() public méthode

Allow retrieval of parsed data structure.
public getParsedPackageData ( ) : array
Résultat array

help() public static méthode

Help output for CLI version
public static help ( )

main() public static méthode

Main method that starts conversion from the command-line
public static main ( )

outputTo() public méthode

Allow setting of the output path location
public outputTo ( string $output_path )
$output_path string The DIRECTORY to write composer.json into

setAutoload() public méthode

Set up any autoload configuration necessary
public setAutoload ( array $config ) : self
$config array
Résultat self

setBinFiles() public méthode

Set bin-files list
public setBinFiles ( array $files ) : self
$files array
Résultat self

setBranchAlias() public méthode

Set up any branch-alias that may be specified
public setBranchAlias ( $aliases ) : self
Résultat self

setDependencyMap() public méthode

Set a name mapping to dependencies. Naming conventions can vary between PEAR-style and composer/github style.
public setDependencyMap ( array $map ) : self
$map array
Résultat self

setExtra() public méthode

Set the entire 'extra' array
See also: http://getcomposer.org/doc/04-schema.md#extra
public setExtra ( $extra ) : self
Résultat self

setExtraSuggestions() public méthode

Set extra suggestions for features, beyond what is mentioned in package.xml
public setExtraSuggestions ( array $suggestions ) : self
$suggestions array
Résultat self

setHomepage() public méthode

package search tools.
public setHomepage ( string $homepage ) : self
$homepage string
Résultat self

setIncludePath() public méthode

If you must, set up any include paths, relative to vendor dir
public setIncludePath ( array $list ) : self
$list array of paths
Résultat self

setKeywords() public méthode

Set keywords which will be picked up by Packagist and/or other package search tools.
public setKeywords ( array $keywords ) : self
$keywords array
Résultat self

setLicense() public méthode

Set SPDX license string. If omitted, license value from package.xml will be used.
See also: http://www.spdx.org/licenses/
public setLicense ( $license ) : self
Résultat self

setName() public méthode

If not set, the channel suggestedalias will be combined with lowercase package name.
public setName ( string $name ) : self
$name string
Résultat self

setRepositories() public méthode

* Horde
public setRepositories ( $repos )

setSupportInfo() public méthode

Set keywords which will be picked up by Packagist and/or other package search tools.
public setSupportInfo ( $support ) : self
Résultat self

setType() public méthode

Set the type of composer package. Defaults to 'library'
public setType ( $type ) : self
Résultat self

writeTimeToComposer() public méthode

Should release date/time information from package.xml be written to composer.json?
public writeTimeToComposer ( $bool ) : self
Résultat self

writeVersionToComposer() public méthode

Should version information from package.xml be written to composer.json?
public writeVersionToComposer ( $bool ) : self
Résultat self

Property Details

$autoload protected_oe property

protected $autoload

$bin_files protected_oe property

protected $bin_files

$branch_alias protected_oe property

protected $branch_alias

$config protected_oe property

protected $config

$data protected_oe property

protected $data

$dependency_map protected_oe property

protected $dependency_map

$extra protected_oe property

protected $extra

$extra_suggestions protected_oe property

protected $extra_suggestions

$homepage protected_oe property

protected $homepage

$include_path protected_oe property

protected $include_path

$keywords protected_oe property

protected $keywords

$license protected_oe property

protected $license

$name protected_oe property

protected $name

$output_file public_oe property

public $output_file

$package2file_path protected_oe property

protected $package2file_path

$repositories protected_oe property

* Horde
protected $repositories

$support protected_oe property

protected $support

$type protected_oe property

protected $type

$write_time_to_composer protected_oe property

protected $write_time_to_composer

$write_version_to_composer protected_oe property

protected $write_version_to_composer

$xml protected_oe property

protected $xml