2015-12-02 14:23:39 +00:00
|
|
|
#+TITLE: PHP layer
|
2016-04-13 03:31:38 +00:00
|
|
|
|
2019-05-05 17:26:40 +00:00
|
|
|
#+TAGS: layer|uncategorized
|
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
[[file:img/php.png]]
|
|
|
|
|
2018-09-19 03:54:47 +00:00
|
|
|
* Table of Contents :TOC_4_gh:noexport:
|
2017-05-22 14:16:12 +00:00
|
|
|
- [[#description][Description]]
|
|
|
|
- [[#features][Features:]]
|
|
|
|
- [[#install][Install]]
|
|
|
|
- [[#key-bindings][Key bindings]]
|
2019-04-08 16:59:32 +00:00
|
|
|
- [[#usage][Usage]]
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
* Description
|
|
|
|
This layer adds PHP language support to Spacemacs.
|
2015-06-10 21:16:01 +00:00
|
|
|
|
|
|
|
** Features:
|
2015-06-10 16:44:30 +00:00
|
|
|
- Edit PHP files using [[https://github.com/ejmr/php-mode][php-mode]]
|
|
|
|
- Edit Drupal files
|
2017-05-24 05:18:41 +00:00
|
|
|
- Complete and jump to define with [[https://github.com/xcwen/ac-php][company-php]]
|
2015-06-10 16:44:30 +00:00
|
|
|
- Run tests with PHPUnit
|
|
|
|
- Reformat code with PHP CBF
|
|
|
|
|
|
|
|
The =gtags= layer is recommended to benefit from better =eldoc= and
|
|
|
|
=helm-gtags=.
|
|
|
|
|
|
|
|
* Install
|
2016-01-06 05:21:55 +00:00
|
|
|
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.
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
* Key bindings
|
|
|
|
|
2018-12-05 03:03:03 +00:00
|
|
|
| Key binding | Description |
|
2017-05-24 05:18:41 +00:00
|
|
|
|-------------+-------------------------|
|
|
|
|
| ~SPC m g g~ | jump to define at point |
|
|
|
|
| ~C-t~ | jump back |
|
2017-11-18 22:34:08 +00:00
|
|
|
|
2019-04-08 16:59:32 +00:00
|
|
|
* Usage
|
|
|
|
Because of the way that the ac-php-core package works, there are a couple of simple
|
2017-11-18 22:34:08 +00:00
|
|
|
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
|
2018-09-19 03:54:47 +00:00
|
|
|
|
2018-10-17 04:03:28 +00:00
|
|
|
#+BEGIN_SRC shell
|
|
|
|
cd /root/of/project
|
|
|
|
touch .ac-php-conf.json
|
|
|
|
#+END_SRC
|
2018-09-19 03:54:47 +00:00
|
|
|
|
2017-11-18 22:34:08 +00:00
|
|
|
2. Inside of spacemacs run:
|
2019-04-08 16:59:32 +00:00
|
|
|
= 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.
|