Skip to content

Commit e6c80a3

Browse files
authored
improve installation related doc and settings (#122)
configure composer to use git for phpactor's packages. This makes it easier to start contributing to phpactor itself as it's just a matter of working with git under ~/.emacs.d/phpactor/vendor/phpactor add notice in the README about where phpactor is installed add second installation possibility using straight.el move completion elisp related config to ad hoc section in README
1 parent c6210fd commit e6c80a3

File tree

2 files changed

+56
-17
lines changed

2 files changed

+56
-17
lines changed

README.org

+52-16
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,54 @@ This package is Emacs interface to [[http://phpactor.github.io/phpactor/][Phpact
99
<a href="http://melpa.org/#/phpactor"><img alt="MELPA: phpactor" src="http://melpa.org/packages/phpactor-badge.svg"></a>
1010
<a href="http://stable.melpa.org/#/phpactor"><img alt="MELPA stable: phpactor" src="http://stable.melpa.org/packages/phpactor-badge.svg"></a>
1111
#+END_HTML
12-
** Instalation
12+
** Installation
1313

1414
*Requirement*: You need to have composer globally installed.
1515

16-
Installation with use-package :
16+
*** First step
17+
**** Installation with use-package :
1718

18-
#+BEGIN_SRC emacs-lisp
19-
(use-package phpactor :ensure t)
20-
(use-package company-phpactor :ensure t)
21-
(use-package php-mode
22-
;;
23-
:hook ((php-mode . (lambda () (set (make-local-variable 'company-backends)
24-
'(;; list of backends
25-
company-phpactor
26-
company-files
27-
))))))
28-
#+END_SRC
19+
#+BEGIN_SRC emacs-lisp
20+
(use-package phpactor :ensure t)
21+
(use-package company-phpactor :ensure t)
22+
#+END_SRC
23+
24+
**** Installation with straight.el
25+
26+
(here using straight.el with use-package)
2927

30-
After having installed this package, run `phpactor-install-or-update` (this will install a supported version of phpactor inside `.emacs.d/phpactor`).
28+
#+BEGIN_SRC emacs-lisp
29+
(use-package phpactor
30+
:straight (phpactor
31+
:host github
32+
:type git
33+
:repo "emacs-php/phpactor.el"
34+
:branch "master"
35+
:files ("*.el" "composer.json" "composer.lock" (:exclude "*test.el"))
36+
)
37+
)
38+
#+END_SRC
3139

32-
*NOTICE*: To ensure the supported version of Phpactor is installed, you might need to run this command again after an upgrade of this package.
40+
*** Second step
41+
After having installed this package, run `phpactor-install-or-update` (this will install a supported version of phpactor inside `.emacs.d/phpactor`).
3342

34-
Alternatively, you can install Phpactor on your own and configure `phpactor-executable` but please be aware that any change in Phpactor's rpc protocol can introduce breakages.
43+
*NOTICE*: To ensure the supported version of Phpactor is installed, you might need to run this command again after an upgrade of this package.
44+
45+
Alternatively, you can install Phpactor on your own and configure `phpactor-executable` but please be aware that any change in Phpactor's rpc protocol can introduce breakages.
3546

3647

3748
** Configuration
49+
*** completion
50+
#+BEGIN_SRC emacs-lisp
51+
(use-package php-mode
52+
;;
53+
:hook ((php-mode . (lambda () (set (make-local-variable 'company-backends)
54+
'(;; list of backends
55+
company-phpactor
56+
company-files
57+
))))))
58+
#+END_SRC
59+
3860
*** eldoc integration
3961

4062
#+BEGIN_SRC elisp
@@ -89,3 +111,17 @@ You can run ``phpactor-status`` while visiting a project file.
89111
If needed, configure [[https://github.com/emacs-php/php-mode/blob/1f04813f46219e626b385d0d96abefad914bfae0/php-project.el#L54][the way the project root is detected]] via .dir-locals.el
90112

91113
"*Phpactor Output*" buffer might also contain useful informations.
114+
115+
** About Phpactor
116+
117+
We will assume your emacs configuration is stored under "~/.emacs.d/"
118+
119+
*** Where is phpactor installed
120+
121+
After running `phpactor-install-or-update`, phpactor should be installed under "~/.emacs.d/phpactor/".
122+
And the phpactor executable should be "~/.emacs.d/phpactor/vendor/bin/phpactor"
123+
124+
*** Contribute to phpactor
125+
126+
Phpactor's packages are cloned (using git) under "~/.emacs.d/phpactor/vendor/phpactor".
127+
If you make a modification to phpactor you'd like to contribute, you can just of git straight away to open a pull request therefrom.

composer.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
"classmap-authoritative": true,
2525
"discard-changes": true,
2626
"optimize-autoloader": true,
27-
"preferred-install": "dist",
27+
"preferred-install": {
28+
"phpactor/*": "source",
29+
"*": "dist"
30+
},
2831
"sort-packages": true,
2932
"platform": {
3033
"php": "7.1.3"

0 commit comments

Comments
 (0)