Skip to content

Commit efacb9b

Browse files
committed
Updating README.md in order to reflect the changes in installation menthod (this is a WordPress plugin now) and configuration (using the constants).
1 parent 03de8f4 commit efacb9b

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,28 @@ Reporting only new issues for specific revision migth be important in case the P
88

99
## Pre-requisities
1010

11-
This project is dependant on a [WordPress](wordpress.org) installation and is meant to be installed as a [WP CLI](wp-cli.org) command.
11+
Along a working [WordPress](wordpress.org) installation you'll need a [WP CLI](wp-cli.org) installed since you can interact with the plugin via WP CLI only for now.
1212

1313
You also will need to have the [PHP CodeSniffer installed on your server](https://github.com/squizlabs/PHP_CodeSniffer#installation).
1414

1515
## Installation steps for this project
1616

17-
Checkout this project to your theme or a plugin and include the `wp-cli-command.php` file for introducing a new command to your WP CLI.
18-
19-
You might want to conditionally include the file only in case the WordPress is loaded as part of WP CLI:
20-
21-
```
22-
if ( defined( 'WP_CLI' ) && WP_CLI ) {
23-
require_once( './wp-cli-command.php' );
24-
}
25-
```
17+
Checkout this repository to your plugins directory and activate the plugin via standard WordPress administration.
2618

2719
# Configuration
2820

29-
This project requires some manual updates to the code in order to make it working.
21+
In order to be able to properly use this plugin you'll have to add some constants to your wp-config.php file.
3022

3123
## PHPCS
3224

33-
If default values for running PHPCS command does not match your environment (see https://github.com/Automattic/phpcs-diff/blob/master/class-phpcs-diff.php#L5 ), you either need to hardcode them to the `PHPCS_Diff` class, or pass those in the `(array) $options` param to class' constructor from the WP CLI command - https://github.com/Automattic/phpcs-diff/blob/master/wp-cli-command.php#L64
25+
If default values for running PHPCS command does not match your environment (see https://github.com/Automattic/phpcs-diff/blob/master/class-phpcs-diff.php#L5 ), you need to override those via constants located in wp-config.php of your WordPress installation:
26+
27+
```
28+
define( 'PHPCS_DIFF_COMMAND', 'phpcs' );
29+
define( 'PHPCS_DIFF_STANDARDS', 'path/to/phpcs/standards' );
30+
```
31+
32+
Alternatively, if you are using the PHPCS_Diff class outside of this plugin, you can pass those in the `(array) $options` param to class' constructor from the WP CLI command - https://github.com/Automattic/phpcs-diff/blob/master/wp-cli-command.php#L64
3433

3534
```
3635
new PHPCS_Diff( new PHPCS_Diff_SVN( $repo ), array( 'phpcs_command' => 'my_phpcs_command', 'standards_location' => 'my/standards/location' ) );
@@ -40,7 +39,14 @@ new PHPCS_Diff( new PHPCS_Diff_SVN( $repo ), array( 'phpcs_command' => 'my_phpcs
4039

4140
### Credentials
4241

43-
You either need to hardcode SVN credentials to `PHPCS_Diff_SVN` class ( related code: https://github.com/Automattic/phpcs-diff/blob/master/class-phpcs-diff-svn.php#L5 ) or pass those via the `(array) $options` param to class' constructor from the WP CLI command - https://github.com/Automattic/phpcs-diff/blob/master/wp-cli-command.php#L64
42+
You need to provide the plugin SVN credentials. This can be done using following constants put into wp-config.php file of your WordPress installation:
43+
44+
```
45+
define( 'PHPCS_DIFF_SVN_USERNAME', 'my_svn_username' );
46+
define( 'PHPCS_DIFF_SVN_PASSWORD', 'my_svn_password' );
47+
```
48+
49+
Alternatively, if you are using the `PHPCS_Diff` and `PHPCS_Diff_SVN` classes outside of this plugin, you can pass those via the `(array) $options` param to class' constructor from the WP CLI command - https://github.com/Automattic/phpcs-diff/blob/master/wp-cli-command.php#L64
4450

4551
```
4652
new PHPCS_Diff_SVN( $repo, array( 'svn_username' => 'my_username', 'svn_password' => 'my_password' ) );
@@ -66,7 +72,6 @@ For more params of the command, please, see the code directly: https://github.co
6672

6773
# TODO:
6874

69-
- [ ] Make configuration of the environment (phpcs command, standard's location, more repositories registration and svn credentials) easier than manual modification of the code
75+
- [ ] Create an easy way to register custom repositories
7076
- [ ] Create GitHub version control backend
7177
- [ ] Make the WP CLI command version control backend agnostic
72-
- [ ] Turn this into a proper WordPress plugin for easy installation

0 commit comments

Comments
 (0)