Support license key for advanced PHP LSP features. (#476)

* Add optional Intelephense license key support via INTELEPHENSE_LICENSE_KEY environment variable

- Add initializationOptions support to Intelephense LSP server
- Pass license key via licenceKey property when environment variable is set
- Update README.md and DOCKER.md documentation with new environment variable
- Fix docstring comment in _get_initialize_params method

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix formatting

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Colin MollenhourandClaude authored and GitHub committed 2025-08-14 09:56:37 +02:00
1 parent 111a764b0b
commit 16aa8c93dd
3 files changed
+8 -2

No files matched your search

+1
View File
@@ -125,6 +125,7 @@ volumes:
- `SERENA_DOCKER=1`: Set automatically to indicate Docker environment
- `SERENA_PORT`: MCP server port (default: 9121)
- `SERENA_DASHBOARD_PORT`: Web dashboard port (default: 24282)
- `INTELEPHENSE_LICENSE_KEY`: License key for Intelephense PHP LSP premium features (optional)
## Troubleshooting
+1 -1
View File
@@ -100,7 +100,7 @@ With Serena, we provide
* direct, out-of-the-box support for:
* Python
* TypeScript/Javascript
* PHP
* PHP (uses Intelephense LSP; set `INTELEPHENSE_LICENSE_KEY` environment variable for premium features)
* Go (requires installation of gopls)
* Rust
* C#
@@ -101,7 +101,7 @@ class Intelephense(SolidLanguageServer):
@staticmethod
def _get_initialize_params(repository_absolute_path: str) -> InitializeParams:
"""
Returns the initialize params for the TypeScript Language Server.
Returns the initialize params for the Intelephense Language Server.
"""
root_uri = pathlib.Path(repository_absolute_path).as_uri()
initialize_params = {
@@ -124,6 +124,11 @@ class Intelephense(SolidLanguageServer):
],
}
# Add license key if provided via environment variable
license_key = os.environ.get("INTELEPHENSE_LICENSE_KEY")
if license_key:
initialize_params["initializationOptions"] = {"licenceKey": license_key}
return initialize_params
def _start_server(self):