This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/php
2019-05-15 21:08:21 +03:00
..
img
config.el
packages.el
README.org Switch to the new layers generator 2019-05-15 21:08:21 +03:00

PHP layer

/TakeV/spacemacs/media/commit/f2dbe9eff46c8cb255c378d48d75b58202ff36ed/layers/+lang/php/img/php.png

Description

This layer adds PHP language support to Spacemacs.

Features:

  • Edit PHP files using php-mode
  • Edit Drupal files
  • Complete and jump to define with company-php
  • Run tests with PHPUnit
  • Reformat code with PHP CBF

The gtags layer is recommended to benefit from better eldoc and helm-gtags.

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add php to the existing dotspacemacs-configuration-layers list in this file.

Key bindings

Key binding Description
SPC m g g jump to define at point
C-t jump back

Usage

Because of the way that the ac-php-core package works, there are a couple of simple initialization tasks which must occur to get the completion working as it should. On any new project make sure to perform the following initialization tasks:

  1. Run the following

      cd /root/of/project
      touch .ac-php-conf.json
  2. Inside of spacemacs run: = ac-php-remake-tags =

The .ac-php-conf.json file is required to enable auto-completion. When you run ac-php-remake-tags and your .ac-php-conf.json file is empty the default configuration will be used and inserted in the file.

If your project contains the following files at the root folder:

  1. .projectile
  2. vendor/autoload.php

the necessary configuration file (.ac-php-conf.json) will be created automatically if it does not exist.