PK O1CVΓn n phpunit.xml.distnu W+A
src/
tests/
PK O1CV"{2 {2
composer.locknu W+A {
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f1bd7ed2196060765aab7ec2d763651e",
"packages": [
{
"name": "monolog/monolog",
"version": "1.25.3",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "fa82921994db851a8becaf3787a9e73c5976b6f1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/fa82921994db851a8becaf3787a9e73c5976b6f1",
"reference": "fa82921994db851a8becaf3787a9e73c5976b6f1",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"psr/log": "~1.0"
},
"provide": {
"psr/log-implementation": "1.0.0"
},
"require-dev": {
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
"doctrine/couchdb": "~1.0@dev",
"graylog2/gelf-php": "~1.0",
"jakub-onderka/php-parallel-lint": "0.9",
"php-amqplib/php-amqplib": "~2.4",
"php-console/php-console": "^3.1.3",
"phpunit/phpunit": "~4.5",
"phpunit/phpunit-mock-objects": "2.3.0",
"ruflin/elastica": ">=0.90 <3.0",
"sentry/sentry": "^0.13",
"swiftmailer/swiftmailer": "^5.3|^6.0"
},
"suggest": {
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
"ext-mongo": "Allow sending log messages to a MongoDB server",
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
"mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
"php-console/php-console": "Allow sending log messages to Google Chrome",
"rollbar/rollbar": "Allow sending log messages to Rollbar",
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
"sentry/sentry": "Allow sending log messages to a Sentry server"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Monolog\\": "src/Monolog"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
}
],
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
"homepage": "http://github.com/Seldaek/monolog",
"keywords": [
"log",
"logging",
"psr-3"
],
"time": "2019-12-20T14:15:16+00:00"
},
{
"name": "pear/net_growl",
"version": "2.7.0",
"source": {
"type": "git",
"url": "https://github.com/pear/Net_Growl.git",
"reference": "9e828a6dde4f85337358209bd98bd260a558e4a9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pear/Net_Growl/zipball/9e828a6dde4f85337358209bd98bd260a558e4a9",
"reference": "9e828a6dde4f85337358209bd98bd260a558e4a9",
"shasum": ""
},
"require": {
"pear/pear_exception": "*",
"php": ">=5.6"
},
"require-dev": {
"phpunit/phpunit": "<6.0"
},
"type": "library",
"autoload": {
"psr-0": {
"Net": "./"
}
},
"notification-url": "https://packagist.org/downloads/",
"include-path": [
"./"
],
"license": [
"BSD License"
],
"authors": [
{
"name": "Laurent Laville",
"email": "pear@laurent-laville.org",
"role": "Lead"
},
{
"name": "Bertrand Mansion",
"email": "bmansion@mamasam.com",
"role": "Lead"
},
{
"name": "Brian Dunnington",
"role": "Helper"
}
],
"description": "More info available on: http://pear.php.net/package/Net_Growl",
"time": "2019-03-05T14:25:46+00:00"
},
{
"name": "pear/pear_exception",
"version": "v1.0.1",
"source": {
"type": "git",
"url": "https://github.com/pear/PEAR_Exception.git",
"reference": "dbb42a5a0e45f3adcf99babfb2a1ba77b8ac36a7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/dbb42a5a0e45f3adcf99babfb2a1ba77b8ac36a7",
"reference": "dbb42a5a0e45f3adcf99babfb2a1ba77b8ac36a7",
"shasum": ""
},
"require": {
"php": ">=4.4.0"
},
"require-dev": {
"phpunit/phpunit": "*"
},
"type": "class",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"classmap": [
"PEAR/"
]
},
"notification-url": "https://packagist.org/downloads/",
"include-path": [
"."
],
"license": [
"BSD-2-Clause"
],
"authors": [
{
"name": "Helgi Thormar",
"email": "dufuz@php.net"
},
{
"name": "Greg Beaver",
"email": "cellog@php.net"
}
],
"description": "The PEAR Exception base class.",
"homepage": "https://github.com/pear/PEAR_Exception",
"keywords": [
"exception"
],
"time": "2019-12-10T10:24:42+00:00"
},
{
"name": "psr/log",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2020-03-23T09:12:05+00:00"
}
],
"packages-dev": [
{
"name": "bartlett/monolog-callbackfilterhandler",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/llaville/monolog-callbackfilterhandler.git",
"reference": "8ada2b01b48e8f06e578ccba9d5c867a2420cba7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/llaville/monolog-callbackfilterhandler/zipball/8ada2b01b48e8f06e578ccba9d5c867a2420cba7",
"reference": "8ada2b01b48e8f06e578ccba9d5c867a2420cba7",
"shasum": ""
},
"require": {
"monolog/monolog": "~1.10",
"php": ">=5.3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Bartlett\\": "src/Bartlett"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Laurent Laville",
"email": "pear@laurent-laville.org",
"homepage": "https://github.com/llaville",
"role": "Lead"
}
],
"description": "Monolog handler wrapper that filters records based on a list of callback functions",
"homepage": "http://php5.laurent-laville.org/callbackfilterhandler/",
"keywords": [
"handler",
"log",
"logger",
"logging"
],
"time": "2015-04-21T11:26:29+00:00"
},
{
"name": "bartlett/phpunit-loggertestlistener",
"version": "1.7.0",
"source": {
"type": "git",
"url": "https://github.com/llaville/phpunit-LoggerTestListener.git",
"reference": "fb5ae201e67e379b490c205be662f6470b352c0e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/llaville/phpunit-LoggerTestListener/zipball/fb5ae201e67e379b490c205be662f6470b352c0e",
"reference": "fb5ae201e67e379b490c205be662f6470b352c0e",
"shasum": ""
},
"require": {
"php": "^5.4||^7.0",
"psr/log": "^1.0"
},
"require-dev": {
"bartlett/monolog-callbackfilterhandler": "^1.0",
"bartlett/monolog-growlhandler": "^1.0",
"monolog/monolog": "^1.10"
},
"suggest": {
"bartlett/monolog-callbackfilterhandler": "Advanced filtering strategies for Monolog",
"bartlett/monolog-growlhandler": "Sends notifications to Growl for Monolog",
"monolog/monolog": "For advanced logging strategies"
},
"type": "library",
"autoload": {
"psr-4": {
"Bartlett\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Laurent Laville",
"email": "pear@laurent-laville.org",
"homepage": "https://github.com/llaville",
"role": "Lead"
}
],
"description": "PHPUnit Test Suite listener for compatible PSR-3 logger",
"homepage": "https://github.com/llaville/phpunit-LoggerTestListener",
"time": "2018-10-01T19:53:31+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.3.0"
},
"platform-dev": [],
"plugin-api-version": "1.1.0"
}
PK O1CVCn" " LICENSEnu W+A Copyright (c) 2015-2020, Laurent Laville
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 authors 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 OWNER 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.
PK O1CV.
composer.jsonnu W+A {
"name": "bartlett/monolog-growlhandler",
"description": "Monolog handler that send notifications to Growl on Mac OS X and Windows",
"keywords": ["log", "logging", "logger", "handler", "growl", "gntp", "notifications"],
"type": "library",
"license": "BSD-3-Clause",
"homepage": "http://php5.laurent-laville.org/growlhandler/",
"support": {
"source": "https://github.com/llaville/monolog-growlhandler",
"issues": "https://github.com/llaville/monolog-growlhandler/issues"
},
"repositories": [
{
"type": "pear",
"url": "https://pear.php.net"
}
],
"require": {
"php": ">=5.3.0",
"monolog/monolog": "~1.10",
"pear/net_growl": "~2.7"
},
"require-dev": {
"bartlett/monolog-callbackfilterhandler": "~1.0",
"bartlett/phpunit-loggertestlistener": "~1.5"
},
"suggest": {
"bartlett/monolog-callbackfilterhandler": "Advanced filtering strategies for Monolog",
"bartlett/phpunit-loggertestlistener": "Allow logging unit tests to your favorite PSR-3 logger interface"
},
"authors": [
{
"name": "Laurent Laville",
"email": "pear@laurent-laville.org",
"homepage": "https://github.com/llaville",
"role": "Lead"
}
],
"autoload": {
"psr-4": {
"Bartlett\\": "src/Bartlett"
}
},
"autoload-dev": {
"psr-4": {
"Bartlett\\Tests\\Monolog\\Handler\\": "tests/"
}
}
}
PK O1CVc\뇐
README.asciidocnu W+A = GrowlHandler for Monolog
**GrowlHandler** is a handler for Monolog
that send notifications to Growl on Mac OS X and Windows.
== Install
* via https://packagist.org/packages/bartlett/monolog-growlhandler/[packagist] the current source dev-master or the stable version 1.0.0
== Documentation
The documentation for GrowlHandler 1.0 is available
in http://php5.laurent-laville.org/growlhandler/manual/1.0/en/[English]
to read it online or download to read it later (multiple formats).
AsciiDoc source code are available on `docs` folder of the repository.
== Contribute
Contributions to source code and its documentation are always welcome.
As developper, I'm always happy when I have the more informations as possible to check and find out issues.
This is the reason why I've created a https://github.com/llaville/phpunit-LoggerTestListener[PHPUnit TestSuite Listener for compatible PSR-3 Loggers].
And recently, for the php-compatinfo project, I've wrote a new PHPUnit ResultPrinter class, that is based on PSR-3 logger concept.
You can learn more on this http://php5.laurent-laville.org/compatinfo/blog/201505-PHPUnit-ResultPrinter.html[post]
in the CompatInfo's blog.
If you want to use it, then :
- install all the components via Composer
[source,bash]
----
$ php composer.phar require --dev bartlett/monolog-growlhandler
----
- create a `phpunit.xml` file with at least following contents :
[source,xml]
----
src/
tests/
----
- configure the PSR-3 logger in `tests\MonologConsoleLogger.php`, if you want to change some behaviors.
NOTE: Default will log all PHPUnit events in local file `phpunit-growlhandler-php.log`
and log events corresponding to PHPUnit mode (`--verbose`, `--debug`) to the console.
.Output look like
----
PHPUnit 4.6.6 by Sebastian Bergmann and contributors.
Configuration read from C:\home\github\monolog-growlhandler\phpunit.xml
Monolog GrowlHandler Test Suite:
Test suite started with 19 tests
Bartlett\Tests\Monolog\Handler\GrowlHandlerTest:
Test suite started with 19 tests
Bartlett\Tests\Monolog\Handler\GrowlHandlerTest::testIsHandling:
Test suite started with 8 tests
Bartlett\Tests\Monolog\Handler\GrowlHandlerTest::testIsHandling:
Test suite ended. Results OK. Tests: 8, Assertions: 8
Bartlett\Tests\Monolog\Handler\GrowlHandlerTest::testIsHandlingLevel:
Test suite started with 8 tests
Bartlett\Tests\Monolog\Handler\GrowlHandlerTest::testIsHandlingLevel:
Test suite ended. Results OK. Tests: 8, Assertions: 8
Bartlett\Tests\Monolog\Handler\GrowlHandlerTest:
Test suite ended. Results OK. Tests: 0, Assertions: 0
Monolog GrowlHandler Test Suite:
Test suite ended. Results OK. Tests: 19, Assertions: 18
Time: 431 ms, Memory: 9.00Mb
Results OK. Tests: 19, Assertions: 18
----
PK O1CV kc c examples/first_notifications.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @since Example available since Release 1.0.0
*/
$baseDir = dirname(__DIR__);
$vendorDir = $baseDir . '/vendor';
require_once $vendorDir . '/autoload.php';
use Bartlett\Monolog\Handler\GrowlHandler;
use Monolog\Logger;
// Create the logger
$logger = new Logger('my_logger');
// Create some handlers
try {
$growl = new GrowlHandler(
array(), // with all default options
Logger::CRITICAL
);
$logger->pushHandler($growl);
} catch (\Exception $e) {
// Growl server is probably not started
echo $e->getMessage(), PHP_EOL;
}
// You can now use your logger
$logger->addInfo('My logger is now ready');
$logger->addError('An error has occured.');
try {
throw new \RuntimeException();
} catch (\Exception $e) {
$logger->addCritical(
'A critical condition has occured. You will be notified by growl.',
array('exception' => $e)
);
}
PK O1CVnF F examples/growl_conf.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @since Example available since Release 1.0.0
*/
$baseDir = dirname(__DIR__);
$vendorDir = $baseDir . '/vendor';
require_once $vendorDir . '/autoload.php';
use Bartlett\Monolog\Handler\GrowlHandler;
use Bartlett\Monolog\Handler\CallbackFilterHandler;
use Monolog\Logger;
use Monolog\Handler\RotatingFileHandler;
use Monolog\Formatter\LineFormatter;
// Create the logger
$logger = new Logger('growl_conf');
// Create filter rules
$filters = array(
function ($record) {
if ($record['level'] < Logger::WARNING) {
return true;
}
if (!array_key_exists('exception', $record['context'])) {
return false;
}
return (preg_match('/^An error has occured/', $record['message']) === 1);
}
);
// Create some handlers
$stream = new RotatingFileHandler(__DIR__ . DIRECTORY_SEPARATOR . 'growl_conf.log');
$stream->setFilenameFormat('{filename}-{date}', 'Ymd');
$logger->pushHandler($stream);
try {
$resourceDir = __DIR__ . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR;
$notifications = array(
GrowlHandler::DEBUG => array(
'icon' => $resourceDir . 'green.png',
),
GrowlHandler::INFO => array(
'icon' => $resourceDir . 'green.png',
),
GrowlHandler::NOTICE => array(
'icon' => $resourceDir . 'yellow.png',
),
GrowlHandler::WARNING => array(
'icon' => $resourceDir . 'yellow.png',
),
GrowlHandler::ERROR => array(
'icon' => $resourceDir . 'red.png',
),
GrowlHandler::CRITICAL => array(
'icon' => $resourceDir . 'red.png',
),
GrowlHandler::ALERT => array(
'icon' => $resourceDir . 'red.png',
),
GrowlHandler::EMERGENCY => array(
'icon' => $resourceDir . 'red.png',
),
);
$options = array(
'AppIcon' => dirname(__DIR__) . '/vendor/pear-pear.php.net/Net_Growl/data/Net_Growl/data/128/growl-starkicon.png',
// if you have troubles with Net_Growl then debug requests to a local file
//'debug' => __DIR__ . '/net_growl_debug.log',
);
$growl = new GrowlHandler(
array(
'name' => 'My Custom Growl',
'notifications' => $notifications,
'options' => $options,
)
);
$growl->setFormatter(
new LineFormatter("%message%\n%level_name%")
);
$logger->pushHandler(new CallbackFilterHandler($growl, $filters));
} catch (\Exception $e) {
// Growl server is probably not started
echo $e->getMessage(), PHP_EOL, PHP_EOL;
}
// You can now use your logger
$logger->addInfo('My logger is now ready');
// This record won't be stopped by the $filters rules, but by the growl $notifications config
$logger->addDebug('A debug message.');
$logger->addError('An error has occured. Will be logged to file BUT NOT notified by Growl.');
try {
throw new \RuntimeException();
} catch (\Exception $e) {
$logger->addCritical(
'An error has occured. Will be logged to file AND notified by Growl.',
array('exception' => $e)
);
}
PK O1CV4 4 examples/long_process.phpnu W+A
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @since Example available since Release 1.0.0
*/
$baseDir = dirname(__DIR__);
$vendorDir = $baseDir . '/vendor';
require_once $vendorDir . '/autoload.php';
use Bartlett\Monolog\Handler\GrowlHandler;
use Bartlett\Monolog\Handler\CallbackFilterHandler;
use Monolog\Logger;
use Monolog\Handler\RotatingFileHandler;
use Monolog\Formatter\LineFormatter;
use Monolog\Processor\PsrLogMessageProcessor;
$processors = array(
new PsrLogMessageProcessor(),
);
// Create the logger
$logger = new Logger('long_process', array(), $processors);
// Create some handlers
$stream = new RotatingFileHandler(__DIR__ . DIRECTORY_SEPARATOR . 'long_process.log');
$stream->setFilenameFormat('{filename}-{date}', 'Ymd');
$logger->pushHandler($stream);
try {
// Create filter rules
$filters = array(
function ($record) {
if (!array_key_exists('count', $record['context'])) {
return false;
}
return ($record['context']['count'] > 5);
}
);
$growl = new CallbackFilterHandler(
new GrowlHandler(
array(), // with all default options
Logger::INFO
),
$filters
);
$logger->pushHandler($growl);
} catch (\Exception $e) {
// Growl server is probably not started
echo $e->getMessage(), PHP_EOL;
}
// Processing each file in a queue
$queue = new \SplQueue();
for ($i = 1; $i < 10; $i++) {
$queue->enqueue( sprintf('File_%02d.txt', $i) );
}
$fileCount = count($queue);
while (!$queue->isEmpty()) {
$file = $queue->dequeue();
$logger->addInfo('Processing file "{filename}"', array('filename' => $file));
echo '.';
// simulate the long process
sleep(1);
}
$logger->addInfo(
'Long Process with {count} files, is over !',
array('count' => $fileCount)
);
PK O1CVe e examples/images/yellow.pngnu W+A PNG
IHDR @ @ iq bKGD pHYs tIME1 Mb
iTXtComment Created with GIMPd.e IDATxoTUg^"VDdTD$ o_{|3bDEC@Rzvf:^;iZ{:^朳[e?IlչT
H
- & ^zp
\sh\'õ{`&Vf[O%`XODT80
Li`>6!ob;-~0pB0@0=&M"I`1Y48|DsF9pN[@H
4Z0pxILY6)7-\-:g&lR
\k
L_ IٻH
LJY/JLF@W3p IUr\KdN8
pPc! p~6Y,.aG7@K, \o BN1b
on
j
X\_ckڵx^@n&