a fork of eloquent/composer-config-reader, A light-weight component for reading Composer configuration files.
A light-weight component for reading Composer configuration files.
Composer configuration reader is very simple to use, and a quick example should be self-explanatory:
$reader = new Eloquent\Composer\Configuration\ConfigurationReader; $configuration = $reader->read('/path/to/composer.json'); echo $configuration->name(); // outputs the package name
The following are the objects used to represent the configuration information. For a more detailed overview of the data available, simply look through the class definition (these classes are very simple).
The following classes all exist in the
This is the main configuration object and has methods to access all the information available in the Composer schema.
name(): The package name.
description(): The package description.
dependencies(): Equivalent to Composer
devDependencies(): Equivalent to Composer
autoloadPSR0(): The autoload information for PSR-0 namespaces/paths.
autoloadClassmap(): The autoload information for classmapped paths.
A number of helper methods exist on the main configuration object to simplify the process of extracting useful information:
projectName(): The project name without the vendor prefix.
vendorName(): The vendor name without the project suffix.
require-devinto a single array.
allPSR0SourcePaths(): A flat array of all PSR-0-compliant source paths.
allSourcePaths(): A flat array of all source paths.
These objects describe the package's defined repositories.
All repositories are represented by the
Repository class, except for
package-type repositories which use the
type(): The repository type.
url(): The repository URL (not available for
This object is an enumeration of package stabilities, with the following members:
It is currently only used to represent the value of the minimum-stability option.
This object contains all information provided for a specific author.
name(): The author's name.
email(): The author's email address.
This object describes the package's support contact information.
email(): The support email address.
issues(): The URL of the issue tracking system.
wiki(): The URL of the wiki system.
This object describes configuration options specific to end-projects, such as the target directories for various resources provided by Composer.
vendorDir(): The project's vendor directory path.
binDir(): The project's binary directory path.
This object describes the Composer scripts defined by the package.
preInstallCmd(): The pre-install scripts.
postInstallCmd(): The post-install scripts.
This object describes the settings for creating package archives.
exclude(): A list of file exclusion patterns.