Skip to content

Commit 40922d8

Browse files
authored
Added info about Phive installation
1 parent 4064632 commit 40922d8

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

README.md

+21-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
About
2-
-----
1+
## About
32

43
PHP\_CodeSniffer is a set of two PHP scripts; the main `phpcs` script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second `phpcbf` script to automatically correct coding standard violations. PHP\_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.
54

65
[![Build Status](https://travis-ci.org/squizlabs/PHP_CodeSniffer.svg?branch=phpcs-fixer)](https://travis-ci.org/squizlabs/PHP_CodeSniffer) [![Code consistency](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer/grade.svg)](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer) [![Join the chat at https://gitter.im/squizlabs/PHP_CodeSniffer](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/squizlabs/PHP_CodeSniffer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
76

8-
Requirements
9-
------------
7+
## Requirements
108

119
PHP\_CodeSniffer requires PHP version 5.4.0 or greater, although individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options manual page](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options) for a list of these requirements.
1210

13-
Installation
14-
------------
11+
## Installation
1512

1613
The easiest way to get started with PHP\_CodeSniffer is to download the Phar files for each of the commands:
1714

@@ -21,7 +18,8 @@ The easiest way to get started with PHP\_CodeSniffer is to download the Phar fil
2118
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
2219
php phpcbf.phar -h
2320

24-
If you use Composer you can easily install PHP_CodeSniffer system-wide with the following command:
21+
### Composer
22+
If you use Composer, you can install PHP_CodeSniffer system-wide with the following command:
2523

2624
composer global require "squizlabs/php_codesniffer=*"
2725

@@ -42,28 +40,38 @@ You will then be able to run PHP_CodeSniffer from the vendor bin directory:
4240
./vendor/bin/phpcs -h
4341
./vendor/bin/phpcbf -h
4442

43+
### Phive
44+
If you use Phive, you can install PHP_CodeSniffer as a project tool using the following commands:
45+
46+
phive install phpcs
47+
phive install phpcbf
48+
49+
You will then be able to run PHP_CodeSniffer from the tools directory:
50+
51+
./tools/phpcs -h
52+
./tools/phpcbf -h
53+
54+
### PEAR
4555
If you use PEAR, you can install PHP\_CodeSniffer using the PEAR installer. This will make the `phpcs` and `phpcbf` commands immediately available for use. To install PHP\_CodeSniffer using the PEAR installer, first ensure you have [installed PEAR](http://pear.php.net/manual/en/installation.getting.php) and then run the following command:
4656

4757
pear install PHP_CodeSniffer
4858

59+
### Git Clone
4960
You can also download the PHP\_CodeSniffer source and run the `phpcs` and `phpcbf` commands directly from the Git clone:
5061

5162
git clone https://github.com/squizlabs/PHP_CodeSniffer.git
5263
cd PHP_CodeSniffer
5364
php bin/phpcs -h
5465
php bin/phpcbf -h
5566

56-
Documentation
57-
-------------
67+
## Documentation
5868

5969
The documentation for PHP\_CodeSniffer is available on the [Github wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki).
6070

61-
Issues
62-
------
71+
## Issues
6372

6473
Bug reports and feature requests can be submitted on the [Github Issue Tracker](https://github.com/squizlabs/PHP_CodeSniffer/issues).
6574

66-
Contributing
67-
-------------
75+
## Contributing
6876

6977
See [CONTRIBUTING.md](CONTRIBUTING.md) for information.

0 commit comments

Comments
 (0)