explaingit

phar-io/manifest

7,487PHPAudience · developerComplexity · 2/5Setup · easy

TLDR

A PHP library that reads and writes XML manifest files for PHP Archive (PHAR) packages, describing their version, license, author info, and bundled dependencies.

Mindmap

mindmap
  root((manifest))
    What it does
      Read PHAR manifests
      Write PHAR manifests
      Serialize to XML
    Manifest contents
      Name and version
      License info
      Author details
      PHP requirements
      Bundled packages
    Tech stack
      PHP
      XML
      Composer
    Audience
      PHP tool developers
      Indirect dependency
      phar.io ecosystem
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Inspect an existing PHAR archive's declared dependencies and PHP version requirements programmatically.

USE CASE 2

Generate a valid XML manifest when building your own PHP tool packaged as a PHAR file.

USE CASE 3

Validate that a PHAR's manifest correctly records its author and license before publishing.

Tech stack

PHPComposerXML

Getting it running

Difficulty · easy Time to first run · 5min
No license information was mentioned in the explanation.

In plain English

This is a PHP library for reading and writing manifest files associated with PHP Archives, which are single-file bundles of PHP applications or libraries with a .phar extension. A manifest in this context is an XML file that describes the archive's name, version, license, author information, PHP version requirements, and any other packages bundled inside it. The library lets you load a manifest from an existing XML file and inspect its contents as PHP objects, or build a manifest from scratch in code and serialize it back to XML. The README shows both approaches with code examples and their expected output. This is a developer utility used behind the scenes by PHP tooling, particularly within the phar.io ecosystem, which is a distribution channel for PHP tools packaged as PHAR archives. Most PHP developers would encounter this library as an indirect dependency pulled in by tools like PHPUnit or Composer rather than using it directly. Installation is handled through Composer, the standard PHP package manager. It can be added as a regular dependency or a development-only dependency depending on your needs.

Copy-paste prompts

Prompt 1
Using the phar-io/manifest PHP library, write code that loads a manifest.xml from a PHAR file and prints the declared PHP version requirement and all bundled package names.
Prompt 2
Show me how to build a new phar-io/manifest Manifest object in PHP with a package name, version, author, and MIT license, then serialize it to an XML string.
Prompt 3
I have an existing PHAR archive. Using phar-io/manifest, write a PHP script that reads its manifest and checks whether the declared minimum PHP version is satisfied by the current PHP runtime.
Prompt 4
Write a Composer install command for phar-io/manifest as a dev dependency, then show the minimal PHP code to parse a manifest.xml file and list all contained packages.
Open on GitHub → Explain another repo

← phar-io on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.