From 5121d19fedddb30534d444839786b69508db2321 Mon Sep 17 00:00:00 2001 From: Eric Stern Date: Wed, 28 Oct 2026 12:36:48 -0700 Subject: [PATCH] Load Composer's autoloader when installed as a dependency Co-Authored-By: Claude Opus 5.5 --- bin/php-lsp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/php-lsp b/bin/php-lsp index cffd1712..1e661ec8 100755 --- a/bin/php-lsp +++ b/bin/php-lsp @@ -7,7 +7,8 @@ declare(strict_types=1); ini_set('display_errors', '0'); ini_set('log_errors', '1'); -require __DIR__ . '/../vendor/autoload.php'; +// Composer's vendor/bin proxy sets this when the package is installed as a dependency. +require $GLOBALS['_composer_autoload_path'] ?? __DIR__ . '/../vendor/autoload.php'; use Firehed\Container\AutoDetect; use Firehed\PhpLsp\Server;