Download the PHP package sbominator/transformatron without Composer
On this page you can find all versions of the php package sbominator/transformatron. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sbominator/transformatron
More information about sbominator/transformatron
Files in sbominator/transformatron
Package transformatron
Short Description A PHP library to transforms SBOMs between SPDX and CycloneDX formats
License MIT
Informations about the package transformatron
SBOMinator Transformatron
A PHP library for transforming Software Bill of Materials (SBOM) between SPDX and CycloneDX formats.
Installation
Install via Composer:
Requirements
- PHP 8.0 or higher
- ext-json extension
Basic Usage
The library provides simple methods for converting between SPDX and CycloneDX formats:
CLI Usage
Transformatron can be used directly on the CLI:
The CLI tool supports the ability to automatically detect source and target versions, but they can also be specified manually:
Advanced Usage
Auto-detecting Format
The library can automatically detect the source format and convert to the specified target format:
Accessing Conversion Details
The ConversionResult
object provides detailed information about the conversion:
Specialized Converters
If you need more control, you can work with the specialized converters directly:
Using the Converter
The Converter
class is designed to be simple to use with sensible defaults:
Features
- Convert between SPDX 2.3 and CycloneDX 1.4 JSON formats
- Auto-detection of source formats
- Comprehensive field mapping:
- Document metadata and creation information
- Packages/Components with detailed properties
- Dependencies and relationships
- License information with support for expressions
- Hash/checksum data with multiple algorithms
- Detailed validation with warnings and errors
- Exception handling for validation and conversion errors
Supported Field Mappings
SPDX to CycloneDX
spdxVersion
→specVersion
dataLicense
→license
name
→name
SPDXID
→serialNumber
documentNamespace
→documentNamespace
creationInfo
→metadata
packages
→components
relationships
→dependencies
CycloneDX to SPDX
bomFormat
→ (no direct mapping)specVersion
→spdxVersion
version
→ (no direct mapping)serialNumber
→SPDXID
name
→name
metadata
→creationInfo
components
→packages
dependencies
→relationships
Running Tests
To run the test suite:
Error Handling
The library provides two main exception types:
ValidationException
: Thrown when the input JSON is invalid or required fields are missingConversionException
: Thrown when the conversion process fails due to errors
Additionally, the ConversionResult
class collects warnings and non-critical errors during the conversion process.
License
MIT License
Contributing
please see CONTRIBUTING.md for more information.
All versions of transformatron with dependencies
ext-json Version *