Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Revert back support for nella/monolog-tracy 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrtak-CZ committed Jan 18, 2016
1 parent 330c345 commit ea46ff3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -32,7 +32,7 @@
},
"require": {
"php": "~5.6|~7.0",
"nella/monolog-tracy": "~1.2",
"nella/monolog-tracy": "~1.1",
"symfony/config": "~2.6|~3.0",
"symfony/dependency-injection": "~2.6|~3.0",
"symfony/expression-language": "~2.6|~3.0",
Expand Down
9 changes: 8 additions & 1 deletion src/DependencyInjection/MonologTracyExtension.php
Expand Up @@ -11,6 +11,7 @@

namespace Nella\MonologTracyBundle\DependencyInjection;

use Nella\MonologTracy\Tracy\BlueScreenFactory;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
Expand Down Expand Up @@ -166,7 +167,13 @@ private function setupBlueScreenFactory(ContainerBuilder $container, array $conf

$this->processInfoItems($definition, $infoItems);
$this->processPanels($definition, $config[Configuration::PANELS]);
$this->processCollapsePaths($definition, $config[Configuration::COLLAPSE_PATHS]);
if (method_exists(BlueScreenFactory::class, 'registerCollapsePath')) {
$this->processCollapsePaths($definition, $config[Configuration::COLLAPSE_PATHS]);
} elseif (count($config[Configuration::COLLAPSE_PATHS]) > 0) {
throw new \Nella\MonologTracyBundle\DependencyInjection\UnsupportedException(
'Sorry "collapse_paths" are supported only for nella/monolog-tracy 1.2+'
);
}

$container->setDefinition($serviceId, $definition);
}
Expand Down
22 changes: 22 additions & 0 deletions src/DependencyInjection/UnsupportedException.php
@@ -0,0 +1,22 @@
<?php
/**
* This file is part of the Nella Project (https://monolog-tracy.nella.io).
*
* Copyright (c) 2014 Pavel Kučera (http://github.com/pavelkucera)
* Copyright (c) Patrik Votoček (https://patrik.votocek.cz)
*
* For the full copyright and license information,
* please view the file LICENSE.md that was distributed with this source code.
*/

namespace Nella\MonologTracyBundle\DependencyInjection;

class UnsupportedException extends \RuntimeException implements \Nella\MonologTracyBundle\DependencyInjection\Exception
{

public function __construct($message, \Exception $previous = NULL)
{
parent::__construct($message, 0, $previous);
}

}

0 comments on commit ea46ff3

Please sign in to comment.