From b9b988024ef5017fbad58e9af2d3f85053569a16 Mon Sep 17 00:00:00 2001 From: Jared Whiklo Date: Wed, 24 Apr 2024 16:33:48 -0500 Subject: [PATCH] Add a change log --- CHANGELOG.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 15 ++------------- 2 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2cbd423 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,44 @@ +# Change Log + +The purpose of this document is to provide a list of changes included in a release under the covers that +may have an impact on the user. This is not a comprehensive list of all changes, but hopefully catches most and +provides a reasoning for the changes. + +## v5.0.0 + +### Added + +#### BagIt Profile support. + +You can now add BagIt Profile(s) to a newly created bag and/or they will be downloaded and parsed when validating an +existing bag, assuming the profile is available at the URL specified in the bag-info.txt file. + +Profiles are validated against the [BagIt Profile Specification (v1.4.0)](https://bagit-profiles.github.io/bagit-profiles-specification/) +and profile rules are enforced when validating a bag (`$bag->isValid()`) and any errors are displayed in the `$bag->getErrors()` array. + +To add a profile to a bag you can use either: +- `$bag->addProfileByJson($jsonString)` - To add a profile from a JSON string. +- `$bag->addProfileByURL($url)` - To add a profile from a URL. + +Profiles are stored internally using their `BagIt-Profile-Identifier` as a key. You can only add a profile once +per identifier. If you try to add a profile with the same identifier it will be ignored. + +To remove a profile you can use `$bag->removeBagProfile($profileIdentifier)` to remove a profile. + +You can also use `$bag->clearAllProfiles()` to remove all profiles from a bag. + +#### Package command validates the bag + +Previous versions allowed you to package without validating the bag. Now the package command will validate the bag +before packaging. If the bag is not valid the package command will fail with a `BagItException::class` being thrown. + +This is due to the addition of BagIt Profile support, if you add a profile to a bag we want to ensure you do not package +an invalid bag. + +TODO: Validate the serialization being attempted during package validation. + +### Removed + +#### PHP 7 Support + +This library now requires PHP 8.0 or higher, while PHP 8.0 is already end of life we will support it for the time being. diff --git a/README.md b/README.md index 0a741f0..4874667 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ Features: * Create an archive (zip, tar, tar.gz, tgz, tar.bz2) * In-place upgrade of bag from v0.97 to v1.0 +## [Change Log](./CHANGELOG.md) + ## Installation **Composer** @@ -60,13 +62,6 @@ The required extensions are: You can integrate BagItTools into your own code as a library using the [API](#api), or use the CLI commands for some simple functionality. -## BagIt Profile Support (v5.0) -You can now add BagIt Profile(s) to a newly created bag and/or they will be downloaded and parsed when validating an -existing bag, assuming the profile is available at the URL specified in the bag-info.txt file. - -Profiles are validated against the [BagIt Profile Specification (v1.4.0)](https://bagit-profiles.github.io/bagit-profiles-specification/) -and profile rules are enforced when validating a bag (`$bag->isValid()`) and any errors are displayed in the `$bag->getErrors()` array. - ### Command line #### Validating a bag @@ -212,9 +207,3 @@ $bag->package('./archive.tar.bz2'); ## License [MIT](./LICENSE) - -## Development - -To-Do: - -* CLI interface to handle simple bag CRUD (CReate/Update/Delete) functions.