Repository navigation
fix: Rename PEAR shim class to PearCompat - #7
Merged
ralflang merged 1 commit intoDec 5, 2026
Merged
Conversation
Horde\Exception\PEAR and Horde\Exception\Pear are the same class name in PHP, which treats class names case-insensitively. Whichever loads first wins: once the global PEAR shim has loaded Horde\Exception\PEAR, Horde\Exception\Pear::catchError() is undefined, and the reverse order breaks PEAR::raiseError(). On case-insensitive filesystems (macOS, Windows) src/PEAR.php and src/Pear.php are also the same file, so a checkout shows a modified file and Composer refuses to update a source install. The shim is now Horde\Exception\PearCompat in src/PearCompat.php. The global PEAR class in compat/ extends it and keeps its name and API.
Member
|
Thank you for reporting. However it triggers the question: Where do you encounter pear errors / pear exceptions in production? |
ralflang
self-requested a review
December 5, 2026 12:50
Contributor
Author
|
I have a project using Imap_Client and ran composer update after switching to FRAMEWORK_6_1, but it wouldn't overwrite vendor/horde/exception. That package had been installed from a git checkout, and git status showed src/Pear.php as modified, although nobody had edited it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Horde\Exception\PEAR(src/PEAR.php) andHorde\Exception\Pear(src/Pear.php) are the same class name in PHP, which treats class names case-insensitively. Whichever is loaded first wins: after the globalPEARshim has loadedHorde\Exception\PEAR,Horde\Exception\Pear::catchError()is undefined, and the reverse order breaksPEAR::raiseError().On case-insensitive filesystems (macOS, Windows) the two files are also the same path, so every checkout shows a modified file and Composer refuses to update source installs ("has uncommitted changes").
The shim is now
Horde\Exception\PearCompat. The globalPEARclass keeps its name and API. A new test uses the shim andPearin one process; it fails on the current branch with "Call to undefined method Horde\Exception\PEAR::catchError()".The only direct user of
Horde\Exception\PEARin the horde organization is horde/Form, which can switch to the globalPEARclass independently of this change: horde/Form#47