ÿØÿà JFIF    ÿÛ „ ( %!1!%*+...983,7(-.- PKpt]¢×¾XÛÛ#Symfony/Bridge/Monolog/CHANGELOG.mdnu„[µü¤CHANGELOG ========= 2.4.0 ----- * added ConsoleHandler and ConsoleFormatter which can be used to show log messages in the console output depending on the verbosity settings 2.1.0 ----- * added ChromePhpHandler PKpt]E˜—ï))Symfony/Bridge/Monolog/LICENSEnu„[µü¤Copyright (c) 2004-2014 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PKpt]|©·…00$Symfony/Bridge/Monolog/composer.jsonnu„[µü¤{ "name": "symfony/monolog-bridge", "type": "symfony-bridge", "description": "Symfony Monolog Bridge", "keywords": [], "homepage": "http://symfony.com", "license": "MIT", "authors": [ { "name": "Fabien Potencier", "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" } ], "require": { "php": ">=5.3.3", "monolog/monolog": "~1.3" }, "require-dev": { "symfony/http-kernel": "~2.2", "symfony/console": "~2.3", "symfony/event-dispatcher": "~2.2" }, "suggest": { "symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.", "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings. You need version ~2.3 of the console for it.", "symfony/event-dispatcher": "Needed when using log messages in console commands" }, "autoload": { "psr-0": { "Symfony\\Bridge\\Monolog\\": "" } }, "target-dir": "Symfony/Bridge/Monolog", "minimum-stability": "dev", "extra": { "branch-alias": { "dev-master": "2.4-dev" } } } PKpt]^Žm« Symfony/Bridge/Monolog/README.mdnu„[µü¤Monolog Bridge ============== Provides integration for Monolog with various Symfony2 components. Resources --------- You can run the unit tests with the following command: $ cd path/to/Symfony/Bridge/Monolog/ $ composer.phar install $ phpunit PKS&]Ëo.†ïï;Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.phpnu„[µü¤ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bridge\Monolog\Tests\Processor; use Monolog\Logger; use Symfony\Bridge\Monolog\Processor\WebProcessor; use Symfony\Component\HttpFoundation\Request; class WebProcessorTest extends \PHPUnit_Framework_TestCase { public function testUsesRequestServerData() { $server = array( 'REQUEST_URI' => 'A', 'REMOTE_ADDR' => 'B', 'REQUEST_METHOD' => 'C', 'SERVER_NAME' => 'D', 'HTTP_REFERER' => 'E' ); $request = new Request(); $request->server->replace($server); $event = $this->getMockBuilder('Symfony\Component\HttpKernel\Event\GetResponseEvent') ->disableOriginalConstructor() ->getMock(); $event->expects($this->any()) ->method('isMasterRequest') ->will($this->returnValue(true)); $event->expects($this->any()) ->method('getRequest') ->will($this->returnValue($request)); $processor = new WebProcessor(); $processor->onKernelRequest($event); $record = $processor($this->getRecord()); $this->assertEquals($server['REQUEST_URI'], $record['extra']['url']); $this->assertEquals($server['REMOTE_ADDR'], $record['extra']['ip']); $this->assertEquals($server['REQUEST_METHOD'], $record['extra']['http_method']); $this->assertEquals($server['SERVER_NAME'], $record['extra']['server']); $this->assertEquals($server['HTTP_REFERER'], $record['extra']['referrer']); } /** * @param integer $level * @param string $message * * @return array Record */ protected function getRecord($level = Logger::WARNING, $message = 'test') { return array( 'message' => $message, 'context' => array(), 'level' => $level, 'level_name' => Logger::getLevelName($level), 'channel' => 'test', 'datetime' => new \DateTime(), 'extra' => array(), ); } } PKS&]&©Ç¦GG;Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.phpnu„[µü¤ * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Bridge\Monolog\Tests\Handler; use Monolog\Logger; use Symfony\Bridge\Monolog\Handler\ConsoleHandler; use Symfony\Component\Console\Output\OutputInterface; /** * Tests the ConsoleHandler and also the ConsoleFormatter. * * @author Tobias Schultze */ class ConsoleHandlerTest extends \PHPUnit_Framework_TestCase { public function testConstructor() { $handler = new ConsoleHandler(null, false); $this->assertFalse($handler->getBubble(), 'the bubble parameter gets propagated'); } public function testIsHandling() { $handler = new ConsoleHandler(); $this->assertFalse($handler->isHandling(array()), '->isHandling returns false when no output is set'); } /** * @dataProvider provideVerbosityMappingTests */ public function testVerbosityMapping($verbosity, $level, $isHandling, array $map = array()) { $output = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); $output ->expects($this->atLeastOnce()) ->method('getVerbosity') ->will($this->returnValue($verbosity)) ; $handler = new ConsoleHandler($output, true, $map); $this->assertSame($isHandling, $handler->isHandling(array('level' => $level)), '->isHandling returns correct value depending on console verbosity and log level' ); } public function provideVerbosityMappingTests() { return array( array(OutputInterface::VERBOSITY_QUIET, Logger::ERROR, false), array(OutputInterface::VERBOSITY_NORMAL, Logger::WARNING, true), array(OutputInterface::VERBOSITY_NORMAL, Logger::NOTICE, false), array(OutputInterface::VERBOSITY_VERBOSE, Logger::NOTICE, true), array(OutputInterface::VERBOSITY_VERBOSE, Logger::INFO, false), array(OutputInterface::VERBOSITY_VERY_VERBOSE, Logger::INFO, true), array(OutputInterface::VERBOSITY_VERY_VERBOSE, Logger::DEBUG, false), array(OutputInterface::VERBOSITY_DEBUG, Logger::DEBUG, true), array(OutputInterface::VERBOSITY_DEBUG, Logger::EMERGENCY, true), array(OutputInterface::VERBOSITY_NORMAL, Logger::NOTICE, true, array( OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE )), array(OutputInterface::VERBOSITY_DEBUG, Logger::NOTICE, true, array( OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE )), ); } public function testVerbosityChanged() { $output = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); $output ->expects($this->at(0)) ->method('getVerbosity') ->will($this->returnValue(OutputInterface::VERBOSITY_QUIET)) ; $output ->expects($this->at(1)) ->method('getVerbosity') ->will($this->returnValue(OutputInterface::VERBOSITY_DEBUG)) ; $handler = new ConsoleHandler($output); $this->assertFalse($handler->isHandling(array('level' => Logger::NOTICE)), 'when verbosity is set to quiet, the handler does not handle the log' ); $this->assertTrue($handler->isHandling(array('level' => Logger::NOTICE)), 'since the verbosity of the output increased externally, the handler is now handling the log' ); } public function testGetFormatter() { $handler = new ConsoleHandler(); $this->assertInstanceOf('Symfony\Bridge\Monolog\Formatter\ConsoleFormatter', $handler->getFormatter(), '-getFormatter returns ConsoleFormatter by default' ); } public function testWritingAndFormatting() { $output = $this->getMock('Symfony\Component\Console\Output\ConsoleOutputInterface'); $output ->expects($this->any()) ->method('getVerbosity') ->will($this->returnValue(OutputInterface::VERBOSITY_DEBUG)) ; $output ->expects($this->once()) ->method('write') ->with('[2013-05-29 16:21:54] app.INFO: My info message [] []'."\n") ; $errorOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface'); $errorOutput ->expects($this->once()) ->method('write') ->with('[2013-05-29 16:21:54] app.ERROR: My error message [] []'."\n") ; $output ->expects($this->any()) ->method('getErrorOutput') ->will($this->returnValue($errorOutput)) ; $handler = new ConsoleHandler(null, false); $handler->setOutput($output); $infoRecord = array( 'message' => 'My info message', 'context' => array(), 'level' => Logger::INFO, 'level_name' => Logger::getLevelName(Logger::INFO), 'channel' => 'app', 'datetime' => new \DateTime('2013-05-29 16:21:54'), 'extra' => array(), ); $this->assertTrue($handler->handle($infoRecord), 'The handler finished handling the log as bubble is false.'); $errorRecord = array( 'message' => 'My error message', 'context' => array(), 'level' => Logger::ERROR, 'level_name' => Logger::getLevelName(Logger::ERROR), 'channel' => 'app', 'datetime' => new \DateTime('2013-05-29 16:21:54'), 'extra' => array(), ); $this->assertTrue($handler->handle($errorRecord), 'The handler finished handling the log as bubble is false.'); } } PKS&]ºåKi66'Symfony/Bridge/Monolog/phpunit.xml.distnu„[µü¤ ./Tests/ ./ ./Resources ./Tests PKpt]¢×¾XÛÛ#Symfony/Bridge/Monolog/CHANGELOG.mdnu„[µü¤PKpt]E˜—ï)).Symfony/Bridge/Monolog/LICENSEnu„[µü¤PKpt]|©·…00$¥Symfony/Bridge/Monolog/composer.jsonnu„[µü¤PKpt]^Žm« ) Symfony/Bridge/Monolog/README.mdnu„[µü¤PKS&]Ëo.†ïï;| Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.phpnu„[µü¤PKS&]&©Ç¦GG;ÖSymfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.phpnu„[µü¤PKS&]ºåKi66'ˆ-Symfony/Bridge/Monolog/phpunit.xml.distnu„[µü¤PKâ1