ipunkt / composer-about
Parses composer.lock and returns informations about the used packages
Installs: 9 574
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.0
- illuminate/support: 4.*
This package is auto-updated.
Last update: 2024-10-23 06:22:24 UTC
README
Parses composer.lock and returns informations about the used packages
Usage
Mainly developed for Laravel, but can still be used in all other Frameworks or Vanilla PHP applications.
-
Add service provider to app.config
'Ipunkt\ComposerAbout\ComposerAboutServiceProvider',
-
Use it in your routes.php or Controller action
/** @var \Ipunkt\ComposerAbout\Structure\ComposerStructure $composerAbout */
$composerAbout = App::make('composer-about');
API
ComposerStructure::$hash
Hash of the current installed packages.
ComposerStructure::$packages
A Collection of Package object instances for the packages used.
ComposerStructure::$devpackages
A Collection of Package object instances for the dev packages used.
ComposerStructure::licenses()
An array of all unique licenses for all required packages. Perhaps for a summary of used licenses. Can be very useful, if you want to check, that there is a defined license that you do not want to have.
Package
For current methods please see Ipunkt\ComposerAbout\Structure\Data\Package.php
Package::getName()
Returns the name of the package.
Package::getVersion()
Returns the version of the package.
Package::getDescription()
Returns the description of the package.
Package::getAuthors()
Returns an array of alle Authors...each author has 'name' and 'email' set, if possible.
Package::getLicenses()
Returns the licenses of the package.
Package::getType()
Returns the type of the package. E.g. library
Package::getName()
Returns the name of the package.