2017 © Pedro Peláez
 

library irc-format-stripper

Strips irc formatters from a string

image

sitedyno/irc-format-stripper

Strips irc formatters from a string

  • Monday, December 26, 2016
  • by sitedyno
  • Repository
  • 1 Watchers
  • 4 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

sitedyno/irc-format-stripper

Build Status codecov, (*1)

Library to strip IRC format codes from strings., (*2)

Install

The recommended method of installation is through composer., (*3)

php composer.phar require sitedyno/irc-format-stripper, (*4)

Configuration

There is no configuration at the moment., (*5)

Usage Example

use Sitedyno\Irc\Format\Stripper;

$stripper = new Stripper;
$testMessage = "\x0301This text is black in IRC";
echo $testMessage;
// Outputs: 01This text is black in IRC
$strippedMessage = $stripper->strip($testMessage);
echo $strippedMessage;
// Outputs: This text is black in IRC

Monolog Processor Example

use Sitedyno\Irc\Format\Stripper;

$stripper = new Stripper;
$testMessage = "\x0301This text is black in IRC";
echo $testMessage;
// Outputs: 01This text is black in IRC
$streamHandler = new \Monolog\Handler\StreamHandler(
    'mylog.log',
    \Monolog\Logger::DEBUG
);
$logger = new \Monolog\Logger(
    'mylog',
    [$streamHandler]
);
$logger->pushProcessor(function($record) use ($stripper) {
    $record['message'] = $stripper->strip($record['message']);
    return $record;
});
$logger->info($testMessage);
// Outputs to mylog.log: [2016-12-25 22:00:52] mylog.INFO This text is black in IRC

Testing

To run the unit test suite:, (*6)

curl -s https://getcomposer.org/installer | php
php composer.phar install
./vendor/bin/phpunit

License

Released under the MIT License. See LICENSE.md., (*7)

The Versions

26/12 2016

dev-master

9999999-dev

Strips irc formatters from a string

  Sources   Download

MIT

The Development Requires

format irc color

26/12 2016

v1.0.1

1.0.1.0

Strips irc formatters from a string

  Sources   Download

MIT

The Development Requires

format irc color

21/05 2016

v1.0.0

1.0.0.0

Strips irc formatters from a string

  Sources   Download

MIT

The Development Requires

format irc color