Browse Source

[MonologBundle][BC break] Renamed the type to fingers_crossed and rotating_file

Christophe Coevoet 14 years ago
parent
commit
723f7d46b7

+ 4 - 4
src/Symfony/Bundle/MonologBundle/DependencyInjection/Configuration.php

@@ -61,14 +61,14 @@ class Configuration implements ConfigurationInterface
                             ->scalarNode('ident')->end() // syslog
                             ->scalarNode('facility')->end() // syslog
                             ->scalarNode('max_files')->end() // rotating
-                            ->scalarNode('action_level')->end() // fingerscrossed
-                            ->scalarNode('buffer_size')->end() // fingerscrossed and buffer
-                            ->scalarNode('handler')->end() // fingerscrossed and buffer
+                            ->scalarNode('action_level')->end() // fingers_crossed
+                            ->scalarNode('buffer_size')->end() // fingers_crossed and buffer
+                            ->scalarNode('handler')->end() // fingers_crossed and buffer
                             ->scalarNode('formatter')->end()
                         ->end()
                         ->append($this->getProcessorsNode())
                         ->validate()
-                            ->ifTrue(function($v) { return ('fingerscrossed' === $v['type'] || 'buffer' === $v['type']) && 1 !== count($v['handler']); })
+                            ->ifTrue(function($v) { return ('fingers_crossed' === $v['type'] || 'buffer' === $v['type']) && 1 !== count($v['handler']); })
                             ->thenInvalid('The handler has to be specified to use a FingersCrossedHandler')
                         ->end()
                         ->validate()

+ 2 - 2
src/Symfony/Bundle/MonologBundle/DependencyInjection/MonologExtension.php

@@ -124,7 +124,7 @@ class MonologExtension extends Extension
             ));
             break;
 
-        case 'rotatingfile':
+        case 'rotating_file':
             if (!isset($handler['path'])) {
                 $handler['path'] = '%kernel.logs_dir%/%kernel.environment%.log';
             }
@@ -137,7 +137,7 @@ class MonologExtension extends Extension
             ));
             break;
 
-        case 'fingerscrossed':
+        case 'fingers_crossed':
             if (!isset($handler['action_level'])) {
                 $handler['action_level'] = 'WARNING';
             }

+ 2 - 2
src/Symfony/Bundle/MonologBundle/Resources/config/monolog.xml

@@ -7,9 +7,9 @@
     <parameters>
         <parameter key="monolog.logger.class">Symfony\Bundle\MonologBundle\Logger\Logger</parameter>
         <parameter key="monolog.handler.stream.class">Monolog\Handler\StreamHandler</parameter>
-        <parameter key="monolog.handler.fingerscrossed.class">Monolog\Handler\FingersCrossedHandler</parameter>
+        <parameter key="monolog.handler.fingers_crossed.class">Monolog\Handler\FingersCrossedHandler</parameter>
         <parameter key="monolog.handler.buffer.class">Monolog\Handler\BufferHandler</parameter>
-        <parameter key="monolog.handler.rotatingfile.class">Monolog\Handler\RotatingFileHandler</parameter>
+        <parameter key="monolog.handler.rotating_file.class">Monolog\Handler\RotatingFileHandler</parameter>
         <parameter key="monolog.handler.syslog.class">Monolog\Handler\SyslogHandler</parameter>
         <parameter key="monolog.handler.null.class">Monolog\Handler\NullHandler</parameter>
         <parameter key="monolog.handler.test.class">Monolog\Handler\TestHandler</parameter>

+ 8 - 8
src/Symfony/Bundle/MonologBundle/Tests/DependencyInjection/MonologExtensionTest.php

@@ -59,7 +59,7 @@ class MonologExtensionTest extends TestCase
 
         $loader->load(array(array('handlers' => array(
             'custom' => array('type' => 'stream', 'path' => '/tmp/symfony.log', 'bubble' => true, 'level' => 'ERROR'),
-            'main' => array('type' => 'fingerscrossed', 'action_level' => 'ERROR', 'handler' => 'nested'),
+            'main' => array('type' => 'fingers_crossed', 'action_level' => 'ERROR', 'handler' => 'nested'),
             'nested' => array('type' => 'stream')
         ))), $container);
         $this->assertTrue($container->hasDefinition('monolog.logger'));
@@ -76,7 +76,7 @@ class MonologExtensionTest extends TestCase
         $this->assertDICConstructorArguments($handler, array('/tmp/symfony.log', \Monolog\Logger::ERROR, true));
 
         $handler = $container->getDefinition('monolog.handler.main');
-        $this->assertDICDefinitionClass($handler, '%monolog.handler.fingerscrossed.class%');
+        $this->assertDICDefinitionClass($handler, '%monolog.handler.fingers_crossed.class%');
         $this->assertDICConstructorArguments($handler, array(new Reference('monolog.handler.nested'), \Monolog\Logger::ERROR, 0, false));
     }
 
@@ -88,7 +88,7 @@ class MonologExtensionTest extends TestCase
         $loader->load(array(
             array('handlers' => array(
                 'custom' => array('type' => 'stream', 'path' => '/tmp/symfony.log', 'bubble' => true, 'level' => 'ERROR'),
-                'main' => array('type' => 'fingerscrossed', 'action_level' => 'ERROR', 'handler' => 'nested'),
+                'main' => array('type' => 'fingers_crossed', 'action_level' => 'ERROR', 'handler' => 'nested'),
                 'nested' => array('type' => 'stream')
             )),
             array('handlers' => array(
@@ -109,7 +109,7 @@ class MonologExtensionTest extends TestCase
         $this->assertDICConstructorArguments($handler, array('/tmp/symfony.log', \Monolog\Logger::WARNING, true));
 
         $handler = $container->getDefinition('monolog.handler.main');
-        $this->assertDICDefinitionClass($handler, '%monolog.handler.fingerscrossed.class%');
+        $this->assertDICDefinitionClass($handler, '%monolog.handler.fingers_crossed.class%');
         $this->assertDICConstructorArguments($handler, array(new Reference('monolog.handler.nested'), \Monolog\Logger::ERROR, 0, false));
     }
 
@@ -121,7 +121,7 @@ class MonologExtensionTest extends TestCase
         $loader->load(array(
             array('handlers' => array(
                 'custom' => array('type' => 'stream', 'path' => '/tmp/symfony.log', 'bubble' => true, 'level' => 'ERROR'),
-                'main' => array('type' => 'fingerscrossed', 'action_level' => 'ERROR', 'handler' => 'nested'),
+                'main' => array('type' => 'fingers_crossed', 'action_level' => 'ERROR', 'handler' => 'nested'),
                 'nested' => array('type' => 'stream')
             )),
             array('handlers' => array(
@@ -158,7 +158,7 @@ class MonologExtensionTest extends TestCase
             )),
             array('handlers' => array(
                 'custom' => array('type' => 'stream', 'path' => '/tmp/symfony.log', 'bubble' => true, 'level' => 'WARNING'),
-                'first' => array('type' => 'rotatingfile', 'path' => '/tmp/monolog.log', 'bubble' => true, 'level' => 'ERROR', 'priority' => 3),
+                'first' => array('type' => 'rotating_file', 'path' => '/tmp/monolog.log', 'bubble' => true, 'level' => 'ERROR', 'priority' => 3),
                 'last' => array('type' => 'stream', 'path' => '/tmp/last.log', 'bubble' => true, 'level' => 'ERROR', 'priority' => -3),
             ))
         ), $container);
@@ -180,7 +180,7 @@ class MonologExtensionTest extends TestCase
         $this->assertDICConstructorArguments($handler, array(new Reference('monolog.handler.nested'), 0, \Monolog\Logger::INFO, false));
 
         $handler = $container->getDefinition('monolog.handler.first');
-        $this->assertDICDefinitionClass($handler, '%monolog.handler.rotatingfile.class%');
+        $this->assertDICDefinitionClass($handler, '%monolog.handler.rotating_file.class%');
         $this->assertDICConstructorArguments($handler, array('/tmp/monolog.log', 0, \Monolog\Logger::ERROR, true));
 
         $handler = $container->getDefinition('monolog.handler.last');
@@ -196,7 +196,7 @@ class MonologExtensionTest extends TestCase
         $container = new ContainerBuilder();
         $loader = new MonologExtension();
 
-        $loader->load(array(array('handlers' => array('main' => array('type' => 'fingerscrossed')))), $container);
+        $loader->load(array(array('handlers' => array('main' => array('type' => 'fingers_crossed')))), $container);
     }
 
     /**