From c97726aee0f09ab80dfdd57fcbd0b43cfe696e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Charles=20Del=C3=A9pine?= Date: Wed, 1 Jul 2026 12:46:46 +0200 Subject: [PATCH] fix(prefs): resolve autoloader via composer proxy globals bin/horde-prefs computes the path to vendor/autoload.php using a fixed relative depth from __DIR__. When horde/prefs is installed as a symlink to a git checkout (composer "path" repository, as used in git developer installs), PHP resolves __DIR__ through the symlink target, breaking the fixed-depth assumption and causing the script to fail with "Neither Composer nor PEAR Horde_Autoloader_Default available" even though a valid autoloader exists. The composer-generated bin proxy already computes the correct path via $GLOBALS['_composer_autoload_path'] before including this script. Use it when available, falling back to the existing depth-based paths unchanged for PEAR installs or direct invocation outside the proxy. --- bin/horde-prefs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/horde-prefs b/bin/horde-prefs index 16185c9..2e05712 100755 --- a/bin/horde-prefs +++ b/bin/horde-prefs @@ -76,11 +76,13 @@ use \Composer\InstalledVersions; // Autoloader search run in composer setups $autoloaders = [ + $GLOBALS['_composer_autoload_path'] ?? null, __DIR__ . '/../vendor/autoload.php', // prefs is the root package __DIR__ . '/../../../../vendor/autoload.php', // prefs is in the vendor dir // handle "git developer install" and pear cases 'Horde/Autoloader/Default.php' ]; +$autoloaders = array_filter($autoloaders); foreach ($autoloaders as $autoloader) { if (file_exists($autoloader)) {