PHP library used to parse a CHANGELOG.md file and return JSON output

PHP library used to parse a CHANGELOG.md file and return JSON output

README

Latest Stable Version
Latest Unstable Version
Build Status
Code Coverage
Scrutinizer Code Quality
Total Downloads
License

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 ChangelogParserManagerChangelogManager;

$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);

Source

Add a Comment

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *