Removes container from all Thelia actions, but Modules (#198)

This commit is contained in:
Franck Allimant
2014-01-31 20:04:25 +01:00
parent dfd34bad49
commit 89653f452b
132 changed files with 603 additions and 467 deletions

View File

@@ -121,7 +121,7 @@ class CartController extends BaseFrontController
*/
protected function getCartEvent()
{
$cart = $this->getCart($this->getRequest());
$cart = $this->getCart($this->getDispatcher(), $this->getRequest());
return new CartEvent($cart);
}

View File

@@ -125,7 +125,7 @@ class CustomerController extends BaseFrontController
$this->processLogin($customerCreateEvent->getCustomer());
$cart = $this->getCart($this->getRequest());
$cart = $this->getCart($this->getDispatcher(), $this->getRequest());
if ($cart->getCartItems()->count() > 0) {
$this->redirectToRoute('cart.view');
} else {

View File

@@ -39,7 +39,9 @@
</service>
<service id="debugBar.listener" class="TheliaDebugBar\Listeners\DebugBarListeners">
<argument type="service" id="service_container"/>
<argument type="service" id="debugBar"/>
<argument >%kernel.debug%</argument>
<tag name="kernel.event_subscriber"/>
</service>
</services>

View File

@@ -24,12 +24,11 @@
namespace TheliaDebugBar\Listeners;
use DebugBar\DataCollector\MemoryCollector;
use DebugBar\DataCollector\MessagesCollector;
use DebugBar\DataCollector\PhpInfoCollector;
use DebugBar\DebugBar;
use TheliaDebugBar\DataCollector\PropelCollector;
use DebugBar\DataCollector\TimeDataCollector;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Thelia\Action\BaseAction;
use Thelia\Core\Event\TheliaEvents;
@@ -41,21 +40,28 @@ use Thelia\Core\Event\TheliaEvents;
*/
class DebugBarListeners extends BaseAction implements EventSubscriberInterface {
protected $debugBar;
protected $debugMode;
public function __construct(DebugBar $debugbar, $debugMode)
{
$this->debugBar = $debugbar;
$this->debugMode = $debugMode;
}
public function initDebugBar()
{
$debugBar = $this->container->get("debugBar");
$alternativelogger = null;
if($this->container->getParameter('kernel.debug')) {
if($this->debugMode) {
$alternativelogger = \Thelia\Log\Tlog::getInstance();
}
$debugBar->addCollector(new PhpInfoCollector());
//$debugBar->addCollector(new MessagesCollector());
//$debugBar->addCollector(new RequestDataCollector());
$debugBar->addCollector(new TimeDataCollector());
$debugBar->addCollector(new MemoryCollector());
$debugBar->addCollector(new PropelCollector($alternativelogger));
$this->debugBar->addCollector(new PhpInfoCollector());
//$this->debugBar->addCollector(new MessagesCollector());
//$this->debugBar->addCollector(new RequestDataCollector());
$this->debugBar->addCollector(new TimeDataCollector());
$this->debugBar->addCollector(new MemoryCollector());
$this->debugBar->addCollector(new PropelCollector($alternativelogger));
}
/**