phar-io/manifest
Read, validate, and serialize phar.io manifest.xml metadata for PHAR archives. Provides ManifestLoader/Serializer and rich domain objects for application name, version, type, authors, licenses, and requirements—ideal for tooling and build/test workflows.
Install the package via Composer to enable parsing and generation of PHAR manifest metadata (manifest.xml). Its core use case is inspecting, validating, or generating standardized PHAR metadata — especially in build pipelines, PHAR packaging tools (e.g., Box, custom PHAR builders), or PHAR-aware test suites.
Start by loading an existing manifest (e.g., from a built PHAR or as a build artifact):
use PharIo\Manifest\ManifestLoader;
$manifest = ManifestLoader::fromFile('path/to/manifest.xml');
Then inspect typed metadata via methods like $manifest->getName(), $manifest->getVersion(), $manifest->getRequirements(), etc. For CI automation, you may also generate manifests programmatically (see Usage Examples) to validate compliance or produce metadata artifacts.
php >= 8.2 is declared but toolchain targets PHP 8.0).$manifest->getBundledComponents() to enumerate internal dependencies (e.g., detect outdated components in PHAR).$manifest->getRequirements() to enforce runtime compatibility constraints — critical for PHAR-based CLI tools distributed widely.ManifestSerializer) to ensure compatibility with PHAR tooling that expects phar.io spec compliance.new Manifest(...) constructor) to test PHAR validation, signature checks, or metadata extraction routines in isolation.A typical workflow: load → validate / inspect → react (log, fail, re-serialize) — no config or service container setup required.
manifest.xml. To extract it from a PHAR, you must pre-extract (e.g., Phar::xml() or archive extraction). It does not read PHAR files directly.ManifestLoader::fromFile() throws ManifestException for invalid XML or malformed manifests — wrap all loads in try/catch and log paths for debugging.if ($author->getEmail() && $email = $author->getEmail()->asString()) { ... }.^2.0.2 to avoid PHP 8.1 deprecation warnings; ^2.0.4 ensures PHP 8.4 compatibility. Avoid 2.0.0–2.0.1 on PHP ≥8.0.phar-io/version library rejects non-SEMVER strings (e.g., v1.0 → 1.0.0). Ensure manifest authors use strict semantic versioning.Library, ApplicationName). Prefer $manifest->getType() instanceof Library over reflection or class-name checks.How can I help you explore Laravel packages today?