You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 2013 Daniel Haxney began rewriting parts of PHP Mode in terms of Emacs' built-in CC Mode. This laid the foundation for incorporating some of the inherit IDE-ish features of Emacs, such as CEDET, EDE, and Semantic. Support for these tools continues to improve thanks to the work of Andrea Turso, Steven Rémot, Joris Steyn, and others. If you wish to test, contribute to, or simply experiment with such features then [this thread is a good place to start](https://github.com/emacs-php/php-mode/issues/256).
Copy file name to clipboardExpand all lines: README.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Please submit any bug reports or feature requests by creating issues on [the Git
29
29
Installation
30
30
------------
31
31
32
-
**PHP Mode requires Emacs 24 or later.** PHP Mode may work with older versions of Emacs but this is not guaranteed. Bug reports for problems related to using PHP Mode with older versions of Emacs will most like *not* be addressed.
32
+
**PHP Mode works on Emacs 24.3 or later.** PHP Mode may work with older versions of Emacs but this is not guaranteed. Bug reports for problems related to using PHP Mode with older versions of Emacs will most like *not* be addressed.
33
33
34
34
With GNU Emacs 24 or later then you can use its [package][] feature to install PHP Mode from [MELPA][]. *The [Marmalade][] package repository only has the original PHP Mode from 2004.* Therefore we recommend you use MELPA to install PHP Mode. If you simply do not wish to use the package manager, then all you need to do is download the `php-mode.el` file, place it inside your `load-path`, and optionally add `(require 'php-mode)` to your Emacs configuration to automatically enable PHP Mode whenever you open a PHP file.
35
35
@@ -43,17 +43,17 @@ Additionally, you can add `skeleton/php-ext.el` to your `load-path` to [enable t
43
43
Reporting Bugs
44
44
--------------
45
45
46
-
When reporting a bug please run the function `php-mode-version` and include its output in your bug report. This helps up reproduce any problem you may have.
46
+
When reporting a bug please run the function `M-x php-mode-debug` and include its output in your bug report. This helps up reproduce any problem you may have.
47
47
48
48
49
49
Experimental and In-Progress Features
50
50
-------------------------------------
51
51
52
-
### CC Mode, CEDET, EDE, and Semantic ###
52
+
### CC Mode, CEDET, EDE, and Semantic
53
53
54
54
In 2013 Daniel Haxney began rewriting parts of PHP Mode in terms of Emacs' built-in CC Mode. This laid the foundation for incorporating some of the inherit IDE-ish features of Emacs, such as CEDET, EDE, and Semantic. Support for these tools continues to improve thanks to the work of Andrea Turso, Steven Rémot, Joris Steyn, and others. If you wish to test, contribute to, or simply experiment with such features then [this thread is a good place to start](https://github.com/emacs-php/php-mode/issues/256).
55
55
56
-
### PHP 7 Support ###
56
+
### PHP 7 Support
57
57
58
58
PHP 7 has been released. PHP Mode supports the following features and changes from PHP 7:
59
59
@@ -67,23 +67,23 @@ PHP 7 has been released. PHP Mode supports the following features and changes f
67
67
Features
68
68
--------
69
69
70
-
### New Keywords ###
70
+
### New Keywords
71
71
72
72
Now PHP Mode supports syntax highlighting for new keywords which PHP 5.4 introduced, e.g. those related to traits, such as `insteadof`. Also supported are the older keywords `clone` and `default`.
73
73
74
-
### Constants ###
74
+
### Constants
75
75
76
76
Syntax highlighting includes every magic constant and predefined constant listed on the official PHP site. However, some constants from specific extensions are not currently included.
77
77
78
-
### Traits, Interfaces, and Namespaces ###
78
+
### Traits, Interfaces, and Namespaces
79
79
80
80
Traits, interfaces, and namespaces now appear under Imenu listings. Fontification behaves properly for namespaces as well, so that code like `namespace Foo\Bar\Baz` no longer looks like a warning. This is also true for namespace aliases, e.g. `use <namespace> as <alias>`; currently the aliased name is not listed in Imenu, but future versions will address this.
81
81
82
-
### Treatment of Underscores ###
82
+
### Treatment of Underscores
83
83
84
84
PHP Mode treats underscores as ‘symbol constituents’ (in Emacs terminology) so that you can use keys like `M-f` and `M-b` to move through the individual parts of a variable name like `$foo_bar_baz`.
85
85
86
-
### Chained Method Calls ###
86
+
### Chained Method Calls
87
87
88
88
PHP Mode can align method calls over multiple lines anchored around the `->` operator, e.g.:
89
89
@@ -97,7 +97,7 @@ This behaviour is off by default, but you can customize the variable `php-lineup
97
97
98
98
**Note:** Alignment will only work if you use one of the php-mode coding styles or inherit one of the styles.
99
99
100
-
### Nested Array Formatting ###
100
+
### Nested Array Formatting
101
101
102
102
Nested function calls and `array()` structures now look better by default (or at least in my opinion). Here is an example of the style:
will now appear on Imenu; in this case the name will be `$greet`.
123
123
124
-
### Flymake Support ###
124
+
### Flymake Support
125
125
126
126
By customizing the variable `php-executable` you can enable Flymake mode in order to see warnings and errors in real-time as you write code.
127
127
128
-
### Search Local Documentation ###
128
+
### Search Local Documentation
129
129
130
130
The key command `C-c C-f` will search the PHP website for documentation on the word under the cursor. However, if you have a [local copy of the PHP documentation](http://us2.php.net/download-docs.php) then PHP Mode will try searching that documentation first. All you need to do is customize the variable `php-manual-path` and give it the path to your copy of the documentation. If PHP Mode cannot find something locally then it will still fallback on searching the PHP website.
131
131
132
-
### Executing Regions of PHP ###
132
+
### Executing Regions of PHP
133
133
134
134
The command `php-send-region`, which is bound to `C-c C-r` by default, will execute the selected region of PHP code. In conjunction with the Emacs command `C-x h` you can use this to execute an entire file. Any output will appear in a buffer called `*PHP*`.
135
135
136
-
### PHPDoc Tag / Annotation Highlighting ###
136
+
### PHPDoc Tag / Annotation Highlighting
137
137
138
138
PHPDoc is a documentation format similar to [JavaDoc](https://en.wikipedia.org/wiki/Javadoc).
139
139
@@ -180,9 +180,9 @@ class Product
180
180
181
181
The annotations are the lines that begin with the `@` character, and PHP Mode will give these special highlighting to help them stand out.
182
182
183
-
PHP Mode has not fully supported [PSR-5: PHPDoc (Draft)](https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md) yet.
183
+
PHP Mode has not fully supported [PSR-5: PHPDoc (Draft)](https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md) yet. We want to support them, but the current implementation still limited. See issue [#478](https://github.com/emacs-php/php-mode/issues/478) for details.
184
184
185
-
### Coding Styles ###
185
+
### Coding Styles
186
186
187
187
By default PHP Mode tries to provide a reasonable style for indentation and formatting, which you can use via the function `php-enable-default-coding-style`. However, it provides other options suited for particular projects which you may find useful. Other coding styles are available through these functions:
188
188
@@ -198,7 +198,7 @@ They will help format your code for PEAR/PSR-2 projects, or work on Drupal, Word
With this style method call chains can be formatted with indented continuation and a hanging semi-colon:
204
204
@@ -212,19 +212,19 @@ With this style method call chains can be formatted with indented continuation a
212
212
213
213
This style is used widely throughout Symfony2 source code even if it is not explicitly mentioned in their conventions documents.
214
214
215
-
### Extra Constants ###
215
+
### Extra Constants
216
216
217
217
If you commonly use a framework or library that defines a set of constants then you may wish to customize the value of `php-extra-constants`. It is a list of strings that PHP Mode will treat as additional constants, i.e. providing them the same level syntax highlighting that PHP Mode uses for built-in constants.
218
218
219
-
### Web Mode Constants and Keywords ###
219
+
### Web Mode Constants and Keywords
220
220
221
221
If you use [Web Mode][] then PHP Mode will attempt to use any additional PHP constants and keywords that Web Mode allows you to define.
222
222
223
-
### Avoid HTML Template Compatibility ###
223
+
### Avoid HTML Template Compatibility
224
224
225
225
Many developers use PHP Mode to edit pure PHP scripts (e.g. files with only PHP and no HTML). A basic compatibility layer with HTML has historically been part of PHP Mode but it does not work perfectly and can cause some bad side effects such as slowness and incorrect font locking. Configuring the `php-template-compatibility` property with a `nil` will cancel any attempt of HTML compatibility. [Web Mode](http://web-mode.org/) is a great alternative to PHP Mode if you need to work with PHP scripts that do contain HTML and other markup.
226
226
227
-
### Subword Mode ###
227
+
### Subword Mode
228
228
229
229
GNU Emacs comes with [Subword Mode][], a minor mode that allows you to navigate the parts of a [camelCase][] as if they were separate words. For example, PHP Mode treats the variable `$fooBarBaz` as a whole name by default. But if you enable Subword Mode then Emacs will treat the variable name as three separate words, and therefore word-related commands (e.g. `M-f`, `M-b`, `M-d`) will only affect the camelCase part of the name under the cursor.
230
230
@@ -236,11 +236,11 @@ If you want to always use Subword Mode for PHP files then you can add this to yo
236
236
237
237
The key-binding `C-c C-w` will also toggle Subword Mode on and off.
238
238
239
-
### Amaka Support ###
239
+
### Amaka Support
240
240
241
241
Viewing and editing build scripts for [Amaka](http://trashofmasters.github.io/amaka/) will automatically enable PHP Mode.
0 commit comments