Skip to content

Commit 3de38da

Browse files
committed
restructure readme
1 parent c35647f commit 3de38da

1 file changed

Lines changed: 41 additions & 24 deletions

File tree

readme.md

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,40 @@ Debug/log information is sent completely "out-of-bounds" via websockets. Since
88
All [PHPDebugConsole](https://github.com/bkdotcom/PHPDebugConsole) methods are supported.
99

1010
### Overview
11-
There are 3 parts to this logging solution.
11+
There are 3 parts to this solution.
1212

1313
* This client. Think of this as an undocked (separate-windowed) browser console. Instead of viewing javascript stuff, it's PHP stuff<sup>†</sup>.
14-
* The PHP application thats "publishing" log messages (via [PHPDebugConsole](https://github.com/bkdotcom/PHPDebugConsole))
1514
* [A WAMP (websockets protocol) router](http://wamp-proto.org/implementations/#routers) that serves as a middle man between this client and the PHP application
15+
* The PHP application thats "publishing" log messages (via [PHPDebugConsole](https://github.com/bkdotcom/PHPDebugConsole))
1616

1717
All 3 components *can* be be running on the same server/environment, or be on 3 separate servers, it doesn't matter. I imagine in most cases, this client and the router will be installed on a local dev environment... aka your laptop.
1818

1919
> † PHPDebugConsole also supports output via plain 'ol `<script>` output, ChromeLogger, & FirePHP.. This WAMP solution isn't limited by what the browser's console can do and offers all of the same formatting and features of PHPDebugConsole's HTML output without the disadvantages of being included in the output of your application (or not supported with ajax & CLI applications.
2020
2121
### Installation
2222

23+
24+
#### Prerequisite : Install Composer
25+
2326
**Download Composer** (if not already installed) [more info](https://getcomposer.org/doc/00-intro.md#downloading-the-composer-executable)
2427
`$ curl -sS https://getcomposer.org/installer | php`
2528

29+
----
30+
#### 1. Client
31+
2632
**create a project directory in your webroot**
2733

28-
$ mkdir debugWampClient
29-
$ cd debugWampClient
34+
```
35+
$ mkdir debugWampClient
36+
$ cd debugWampClient
37+
```
3038

31-
**Install this client**
39+
**Install this client**
3240

3341
(make sure you're in the project directory)
3442

3543
`$ php composer.phar require bdk/debug-wamp-client`
3644

37-
**Install a WAMP router** (if you don't already have one)
38-
If you don't already have a WAMP router up and running, you might as well install a PHP-based one here in the same folder *(but again, it could be installed anywhere, or be a node based router)*
39-
One client+router install can support many PHPDebugConsole projects
40-
`$ php composer.phar require voryx/thruway`
41-
42-
**Start the WAMP router.**
43-
`$ php vendor/voryx/thruway/Examples/SimpleWsRouter.php`
44-
*(note that the router doesn't play well with x-debug. You will likely need to disable x-debug for this process. See [this gist](https://gist.github.com/bkdotcom/4b635f7c7c07dd5800dee89cdb99e4f6))*
45-
4645
**Create an `index.php` for the client**
4746

4847
(this index.php should be created in the project directory)
@@ -56,19 +55,29 @@ require __DIR__.'/vendor/autoload.php';
5655
$debug = \bdk\Debug::getInstance();
5756
new \bdk\Debug\WampClient($debug);
5857
```
58+
----
59+
#### 2. Router
5960

60-
**Navigate to the client in your browser**
61-
`http://localhost/debugWampClient`
61+
**Install a WAMP router** (if you don't already have one)
62+
If you don't already have a WAMP router up and running, you might as well install a PHP-based one here in the same folder *(but again, it could be installed anywhere, or be a node based router)*
63+
One client+router install can support many PHPDebugConsole projects
64+
`$ php composer.phar require voryx/thruway`
6265

63-
The client should have connected to the router and is ready to receive log messages
66+
**Start the WAMP router.**
67+
`$ php vendor/voryx/thruway/Examples/SimpleWsRouter.php`
68+
*(note that the router doesn't play well with x-debug. If you have x-debug installed, you will likely need to disable it for this process. See [this gist](https://gist.github.com/bkdotcom/4b635f7c7c07dd5800dee89cdb99e4f6))*
6469

65-
**Add PHPDebugConsole to the project you wish to debug**
66-
`$ php composer.phar require bdk/debug`
70+
----
71+
#### 3. Application You're Debugging
6772

68-
**Install a PHPDebugConsole/outputWamp plugin dependency**
69-
`$ php composer.phar require bdk/wamp-publisher`
73+
**Add PHPDebugConsole and WAMP dependency to the project you wish to debug**
7074

71-
Add the OutputWamp plugin to your application
75+
```
76+
$ php composer.phar require bdk/debug
77+
$ php composer.phar require bdk/wamp-publisher
78+
```
79+
80+
Bootstrap PHPDebugConsole with the WAMP output plugin
7281

7382
```php
7483
require __DIR__.'/vendor/autoload.php'
@@ -83,5 +92,13 @@ $outputWamp = new \bdk\Debug\Output\Wamp($debug, $wampPublisher); // see note b
8392
$debug->addPlugin($outputWamp); // or $debug->setCfg('outputAs', $outputWamp); to prevent the default in-page html output
8493
```
8594

86-
\* The wamp-plugin classname changed in PHPDebugConsole v2.1. If you're using pre 2.1 use:
87-
`new \bdk\Debug\OutputWamp($debug, $wampPublisher);`
95+
\* The wamp-plugin classname changed in PHPDebugConsole v2.1.
96+
If you're using pre-2.1 use: `new \bdk\Debug\OutputWamp($debug, $wampPublisher);`
97+
98+
----
99+
#### Everything's setup and ready
100+
101+
**Navigate to the client in your browser**
102+
`http://localhost/debugWampClient`
103+
104+
The client should connect to the router and is ready to receive log messages

0 commit comments

Comments
 (0)