kern046 / changelog-parser
PHP library used to parse a CHANGELOG.md file and return JSON output
Installs: 5 830
Dependents: 1
Suggesters: 0
Security: 0
Stars: 10
Watchers: 3
Forks: 3
Open Issues: 2
Requires
- php: >=5.5.0
This package is auto-updated.
Last update: 2024-11-07 07:27:50 UTC
README
Introduction
This library is meant to parse changelog files and convert its data to different formats.
It would be used to get dynamically data from a changelog file to inform users about the different versions and their changes.
With this library it is easy to use changelog data in any way.
Installation
You can use composer to set the library as your project dependency
composer require kern046/changelog-parser
Usage
To use this library, you can create an instance of the changelog manager
use ChangelogParser\Manager\ChangelogManager; $changelogManager = new ChangelogManager();
To get the last version data of your changelog file, write the following code :
// The second parameter is optional, default is 'json' $changelogManager->getLastVersion('CHANGELOG.md', 'json');
To get all data contained in the changelog file, use the following method :
// The second parameter is optional, default is 'json' $changelogManager->getAllVersions('CHANGELOG.md', 'json');
The results of these functions are cached.
The default cache validity time is one hour.
You can modify it using the following way :
$cacheManager = $changelogManager->getCacheManager(); // The first argument is the validity time in seconds // In the current example, the cache validity time is one day $cacheManager->setCacheTime(60 * 60 * 24);