Skip to content

About

🐘 PHP language support and development tools for Lumide IDE

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

lumide_php

Lumide Plugin License: MIT

Comprehensive PHP language support and development tooling plugin for Lumide IDE.


Prerequisites

Before using the PHP plugin, make sure the following tools are installed on your system:

1. PHP Runtime (>= 8.0) β€” Required

The plugin relies on the php CLI binary for syntax linting (php -l), built-in web server (php -S), direct script execution, and test runners.

  • macOS (Homebrew):
    brew install php
  • Ubuntu / Debian:
    sudo apt update && sudo apt install php-cli php-mbstring php-xml php-curl
  • Arch Linux:
    sudo pacman -S php
  • Windows:
    • Download from windows.php.net (Thread Safe or Non-Thread Safe x64 ZIP) and add to PATH, or install via:
    choco install php
    # or
    scoop install php

2. PHP Language Server (LSP) β€” Recommended for Code Intelligence

For rich IDE features such as code completions, hover documentation, parameter hints, go-to-definition, and workspace diagnostics:

  • Intelephense (Recommended β€” Fast & Full-featured): Requires Node.js:

    npm install -g intelephense

    (Alternatively, click Install Intelephense (npm) from the PHP Tools menu inside Lumide).

  • Phpactor (PHP-native Language Server & Refactoring Tool): Requires PHP >= 8.2:

    # Install globally with Composer:
    composer global require phpactor/phpactor
    
    # Or install standalone PHAR directly inside Lumide:
    # Click "Install Phpactor (Standalone PHAR)" in the PHP Tools menu.
  • PHP Language Server (felixfbecker/php-language-server):

    composer global require felixfbecker/language-server

3. Composer β€” Recommended for Project Management

Required for dependency management, autoloading, running Composer scripts, and project-local tools:

  • macOS: brew install composer
  • Linux / Windows: Follow instructions on getcomposer.org/download or:
    choco install composer

4. Code Formatters & Test Runners β€” Optional

The plugin automatically discovers and runs tools installed locally in vendor/bin/ (or from global PATH):

Tool Category Installation Command
Pest Test Runner composer require --dev pestphp/pest
PHPUnit Test Runner composer require --dev phpunit/phpunit
Laravel Pint Code Formatter composer require --dev laravel/pint
PHP-CS-Fixer Code Formatter composer require --dev friendsofphp/php-cs-fixer
PHPStan Static Analysis composer require --dev phpstan/phpstan

Features

🐘 Language Server Protocol (LSP)

Connects seamlessly with PHP Language Servers for rich IDE features (completions, parameter hints, go-to-definition, hover docs, workspace symbols, diagnostics):

  • Intelephense (intelephense --stdio) β€” Fast, full-featured default PHP language server.
  • Phpactor (phpactor language-server) β€” Powerful PHP-native language server and refactoring toolkit.
  • PHP Language Server (php-language-server) β€” Pure PHP language server.
  • Custom Executable β€” Use your own custom PHP language server binary or path.
  • Multiple servers β€” Registers each discovered server, including a custom executable.
  • Discovery β€” Finds servers on PATH and Phpactor in plugin storage or Composer locations. PHP: Discover Language Servers adds new servers.
  • Controls β€” Start, restart, stop, disable, or enable servers in Lumide’s LSP & Agents panel.

Requires Lumide multi-server and workspace controls. The plugin shows registration status; Lumide shows each server’s runtime state.

Default order: Intelephense, Phpactor, PHP Language Server, then custom. Set php.lsp.server to choose the first. Lumide combines supported results and uses the first capable server for formatting and rename. Duplicate commands register once.

Install commands add servers without replacing others or clearing disabled choices.

The existing command IDs are retained for keybindings:

Command ID Current title Behavior
php.selectLsp PHP: Discover Language Servers Discovers and registers additional installed servers
php.restartLsp PHP: Language Server Status Lists registered servers and directs you to Lumide’s lifecycle controls

πŸ“¦ Composer Integration

  • Composer: Install β€” Run composer install in an integrated terminal.
  • Composer: Update β€” Run composer update.
  • Composer: Dump Autoload β€” Run optimized classmap generation (composer dump-autoload -o).
  • Composer: Validate β€” Validate composer.json format and dependencies.
  • Composer: Require Package β€” Interactively search and install PHP packages.
  • Composer: Run Script... β€” Interactive quick-pick menu of all custom scripts defined in composer.json.
  • File tree context menu integrations for composer.json.

🌐 Built-in Web Server

  • PHP: Start Built-in Web Server β€” Quickly spin up php -S <host>:<port> without leaving Lumide.
  • PHP: Stop Built-in Web Server β€” Stop the running development server.
  • PHP: Open Server in Browser β€” One-click preview in default browser.
  • Status bar server indicator displaying port and state.

πŸ§ͺ Test Runner (PHPUnit & Pest)

  • PHP: Run All Tests β€” Automatically detects and runs Pest or PHPUnit.
  • PHP: Run Current Test File β€” Run tests specifically for the active open file.

🎨 Linting & Code Formatting

  • Format Document β€” Uses Laravel Pint or PHP-CS-Fixer when installed, including unsaved changes. Set php.formatter to lsp to use the language server instead.
  • PHPStan β€” Shows problems in the editor and Problems panel on save when the project has a phpstan.neon config.
  • Lint on save β€” Runs php -l when no language server is running.
  • PHP: Lint Active File (php -l) β€” Check the active file and show errors in the Problems panel.
  • PHP: Format Active File β€” Format the file on disk with Pint or PHP-CS-Fixer.

Formatting and diagnostics require Lumide 0.23.0 and later.


Configuration

Setting Type Default Description
php.lsp.server string "auto" First server to register: auto, intelephense, phpactor, php-language-server, or custom; all found servers register
php.lsp.path filePath "" Custom server executable (launched with --stdio)
php.executablePath filePath "" Path to php binary
php.composer.path filePath "" Path to composer binary
php.devServer.host string "127.0.0.1" Host address for built-in web server
php.devServer.port number 8000 Port for built-in web server
php.devServer.documentRoot string "" Document root folder (e.g. public or web)
php.intelephense.licenceKey string "" Optional premium licence key for Intelephense
php.formatter string "auto" Formatter: auto, pint, php-cs-fixer, or lsp
php.lint.onSave boolean true Run php -l on open and save when no language server is running
php.phpstan.enabled boolean true Run PHPStan on save when the project has a config

Reload the PHP plugin after changing the preferred server, custom path, or licence key. Manage runtime state in LSP & Agents.

Getting Started

  1. Open any workspace containing PHP files (.php) or composer.json in Lumide IDE.
  2. The plugin activates automatically. Use the PHP status bar menu to discover servers, then manage them in LSP & Agents.

About

🐘 PHP language support and development tools for Lumide IDE

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages