This repository has been archived by the owner on Mar 12, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Added LICENSE and README.md
- Loading branch information
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright (c) 2008-2011, Phergie Development Team | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
Neither the name of the Phergie Development Team nor the names of its | ||
contributors may be used to endorse or promote products derived from this | ||
software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE | ||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# phergie/phergie-irc-client-react | ||
|
||
A bare-bones PHP-based IRC client library built on React. | ||
|
||
## Install | ||
|
||
The recommended method of installation is [through composer](http://getcomposer.org). | ||
|
||
```JSON | ||
{ | ||
"minimum-stability": "dev", | ||
"require": { | ||
"phergie/phergie-irc-client-react": "1.0.0" | ||
} | ||
} | ||
``` | ||
|
||
## Design goals | ||
|
||
* Minimalistic and extensible design | ||
* Informative logging of client-server interactions | ||
* Simple easy-to-understand API | ||
|
||
## Usage | ||
|
||
```php | ||
<?php | ||
$client = new \Phergie\Irc\Client\React\Client(); | ||
$client->addListener(function($message, $write, $connection, $logger) { | ||
// ... | ||
}); | ||
$client->run(); | ||
``` | ||
|
||
* `$message` is an associative array containing data for an event received from the server as obtained by `\Phergie\Irc\Parser`. | ||
* `$write` is an instance of `\Phergie\Irc\Client\React\WriteStream` for sending new events from the client to the server. | ||
* `$connection` is an instance of `\Phergie\Irc\Connection` containing metadata for the connection on which the event occurred. | ||
* `$logger` is an instance of `\Monolog\Logger` for logging any relevant events from the listener. | ||
|
||
## Tests | ||
|
||
To run the unit test suite: | ||
|
||
``` | ||
cd tests | ||
curl -s https://getcomposer.org/installer | php | ||
php composer.phar install | ||
./vendor/bin/phpunit Phergie/Irc/Client/React/TestSuite.php | ||
``` | ||
|
||
## License | ||
|
||
Released under the BSD License. See `LICENSE`. | ||
|
||
## Community | ||
|
||
Check out #phergie on irc.freenode.net. |