@@ -83,6 +83,89 @@ The following packages are suggested:
8383[ phpDox ] : http://phpdox.de
8484[ Sami ] : https://github.com/FriendsOfPHP/sami
8585
86+ ## Usage
87+
88+ This is a simple metapackage which can be used in two different ways; globally installed or on a per project basis.
89+
90+ Both methods have their pros (+) and cons (-).
91+
92+ ** Global installation** :
93+ * \+ All tools are present anywhere on your system
94+ * \+ Can be used on any codebase, even the ones that don't use Composer.
95+ * \- You'll have to update manually, since it's not a project, versioning is not managed.
96+
97+ * Per project installation* :
98+ * \+ Versioning (update/installation) is provided in the project
99+ * \- Tools not available system wide. You'll need to execute them from a specific path.
100+
101+ These methods are not mutual exclusive. You can have your global installed version, which can be used anywhere, but
102+ still use the one provided in a project.
103+
104+ ## Installation
105+
106+ ### Global installation
107+
108+ The following script will install a system wide Composer for you, including the QA tools.
109+
110+ ``` bash
111+ bash <( curl -S https://raw.githubusercontent.com/DealerDirect/php-qa-tools/master/bin/install.sh)
112+ ```
113+
114+ That's it. This can be put in any instructions, such as a README or someone's blog, since the logic is in the shell
115+ script. Provided you download the script using https, the file has standard levels of authentication and encryption
116+ protecting it from manipulation. We also sign the install with a GPG key, this way you can check if the downloaded
117+ releases signature matches the public key of Dealerdirect.
118+
119+ ``` bash
120+ gpg --keyserver hkp://keys.gnupg.net --recv-keys C4133165DF5EB4BAEABDADCACF1E7823C5339B59
121+ curl -O https://raw.githubusercontent.com/DealerDirect/php-qa-tools/master/bin/install.sh
122+ curl -O https://raw.githubusercontent.com/DealerDirect/php-qa-tools/master/bin/install.sh.sig
123+ gpg --verify install.sh.sig
124+ bash install.sh
125+ ```
126+
127+ This is obviously a shell script, if you're really concerned about the argument that it may contain nefarious
128+ activities within, you can easily review it before you run it.
129+
130+ ``` bash
131+ curl -O https://raw.githubusercontent.com/DealerDirect/php-qa-tools/master/bin/install.sh
132+ less install.sh
133+ bash instal.sh
134+ ```
135+
136+
137+
138+ If you already have a global Composer setup, you could include the tools manually, without the need for running
139+ the shell script above.
140+
141+ ``` bash
142+ composer global require " dealerdirect/qa-tools:*"
143+ ```
144+
145+ #### Per project installation
146+
147+ The other option is to install this on a per project basis.
148+
149+ Using Composer (preferred method):
150+
151+ ``` bash
152+ composer require --dev " dealerdirect/qa-tools"
153+ ```
154+
155+ Or modify your ` composer.json ` to include ` dealerdirect/qa-tools ` in the ` require-dev ` sections:
156+
157+ ``` json
158+ {
159+ "name" : " acme/my-project" ,
160+ "require" : {
161+ "…" : " *"
162+ },
163+ "require-dev" : {
164+ "dealerdirect/qa-tools" : " *"
165+ }
166+ }
167+ ```
168+
86169## Contributing
87170
88171This is an active open-source project. We are always open to people who want to use the code or contribute to it.
0 commit comments