PEAR_Exception
The standalone base PEAR_Exception class from PEAR core, packaged for Composer.
Repository Health
Technical Analysis
PEAR_Exception is the base exception class from PEAR core, extracted into its own repository and packaged for Composer. Many long-standing PEAR packages extend this class as the root of their exception hierarchies, and this distribution lets modern projects depend on just that one class without installing the entire PEAR system.
It follows the pear-core repository and is updated whenever a new PEAR version is released, so it stays compatible with the packages that build on it while remaining a tiny, dependency-light building block.
What You Get
- The standalone PEAR_Exception base class from PEAR core
- Composer/Packagist packaging so it installs as a normal dependency
- Support for exception cause chaining in the PEAR convention
- Exception observer/callback hooks inherited from PEAR
- A minimal footprint with no wider PEAR runtime required
Common Use Cases
- Satisfying a PEAR package’s dependency on the base exception class
- Extending PEAR_Exception as the root of a library’s exception hierarchy
- Maintaining or migrating legacy PEAR-based code under Composer
- Reusing PEAR’s exception-chaining semantics without the full PEAR install
Under The Hood
Architecture - The repository contains a single meaningful class under PEAR/Exception.php, autoloaded via a Composer classmap. PEAR_Exception extends PHP’s Exception and adds PEAR-specific features such as cause chaining and observer callbacks that other PEAR packages rely on. It is intentionally a leaf dependency with nothing else attached.
Tech Stack - Pure PHP (>=5.2) with a classmap autoloader over the PEAR/ directory. It carries no runtime dependencies and preserves the original PEAR package.xml metadata alongside the Composer configuration.
Code Quality - The class is long-established, stable, and unchanged except to track pear-core releases. It reflects an older PHP era stylistically but is well understood and heavily depended upon across the PEAR ecosystem, with a tests/ directory included.
API Design - Usage is simply extending PEAR_Exception or catching it, exactly as with any exception class. Its familiarity to PEAR developers and its tiny surface make it a drop-in base with essentially no learning curve.