PHP Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$output_file

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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?

Защищенные методы

Метод Описание
applyConfig ( ) Apply values provided in a config JSON file.
getChannelSuggestedAlias ( $channel )
getDepVersionString ( $req )

Описание методов

__construct() публичный Метод

public __construct ( $package2file, $config = null )

applyConfig() защищенный Метод

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 convert ( $output_file = null )

getChannelSuggestedAlias() защищенный Метод

protected getChannelSuggestedAlias ( $channel )

getDepVersionString() защищенный Метод

protected getDepVersionString ( $req )

getParsedPackageData() публичный Метод

Allow retrieval of parsed data structure.
public getParsedPackageData ( ) : array
Результат array

help() публичный статический Метод

Help output for CLI version
public static help ( )

main() публичный статический Метод

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

outputTo() публичный Метод

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

setAutoload() публичный Метод

Set up any autoload configuration necessary
public setAutoload ( array $config ) : self
$config array
Результат self

setBinFiles() публичный Метод

Set bin-files list
public setBinFiles ( array $files ) : self
$files array
Результат self

setBranchAlias() публичный Метод

Set up any branch-alias that may be specified
public setBranchAlias ( $aliases ) : self
Результат self

setDependencyMap() публичный Метод

Set a name mapping to dependencies. Naming conventions can vary between PEAR-style and composer/github style.
public setDependencyMap ( array $map ) : self
$map array
Результат self

setExtra() публичный Метод

Set the entire 'extra' array
См. также: http://getcomposer.org/doc/04-schema.md#extra
public setExtra ( $extra ) : self
Результат self

setExtraSuggestions() публичный Метод

Set extra suggestions for features, beyond what is mentioned in package.xml
public setExtraSuggestions ( array $suggestions ) : self
$suggestions array
Результат self

setHomepage() публичный Метод

package search tools.
public setHomepage ( string $homepage ) : self
$homepage string
Результат self

setIncludePath() публичный Метод

If you must, set up any include paths, relative to vendor dir
public setIncludePath ( array $list ) : self
$list array of paths
Результат self

setKeywords() публичный Метод

Set keywords which will be picked up by Packagist and/or other package search tools.
public setKeywords ( array $keywords ) : self
$keywords array
Результат self

setLicense() публичный Метод

Set SPDX license string. If omitted, license value from package.xml will be used.
См. также: http://www.spdx.org/licenses/
public setLicense ( $license ) : self
Результат self

setName() публичный Метод

If not set, the channel suggestedalias will be combined with lowercase package name.
public setName ( string $name ) : self
$name string
Результат self

setRepositories() публичный Метод

* Horde
public setRepositories ( $repos )

setSupportInfo() публичный Метод

Set keywords which will be picked up by Packagist and/or other package search tools.
public setSupportInfo ( $support ) : self
Результат self

setType() публичный Метод

Set the type of composer package. Defaults to 'library'
public setType ( $type ) : self
Результат self

writeTimeToComposer() публичный Метод

Should release date/time information from package.xml be written to composer.json?
public writeTimeToComposer ( $bool ) : self
Результат self

writeVersionToComposer() публичный Метод

Should version information from package.xml be written to composer.json?
public writeVersionToComposer ( $bool ) : self
Результат self

Описание свойств

$autoload защищенное свойство

protected $autoload

$bin_files защищенное свойство

protected $bin_files

$branch_alias защищенное свойство

protected $branch_alias

$config защищенное свойство

protected $config

$data защищенное свойство

protected $data

$dependency_map защищенное свойство

protected $dependency_map

$extra защищенное свойство

protected $extra

$extra_suggestions защищенное свойство

protected $extra_suggestions

$homepage защищенное свойство

protected $homepage

$include_path защищенное свойство

protected $include_path

$keywords защищенное свойство

protected $keywords

$license защищенное свойство

protected $license

$name защищенное свойство

protected $name

$output_file публичное свойство

public $output_file

$package2file_path защищенное свойство

protected $package2file_path

$repositories защищенное свойство

* Horde
protected $repositories

$support защищенное свойство

protected $support

$type защищенное свойство

protected $type

$write_time_to_composer защищенное свойство

protected $write_time_to_composer

$write_version_to_composer защищенное свойство

protected $write_version_to_composer

$xml защищенное свойство

protected $xml