diff --git a/composer.lock b/composer.lock index 081028c9f..8b5668da7 100644 --- a/composer.lock +++ b/composer.lock @@ -76,7 +76,7 @@ "authors": [ { "name": "Anthony Ferrara", - "email": "ircmaxell@php.net", + "email": "ircmaxell@ircmaxell.com", "homepage": "http://blog.ircmaxell.com" } ], diff --git a/core/lib/Thelia/Routing/Matcher/ActionMatcher.php b/core/lib/Thelia/Routing/Matcher/ActionMatcher.php deleted file mode 100644 index d4dd7eb37..000000000 --- a/core/lib/Thelia/Routing/Matcher/ActionMatcher.php +++ /dev/null @@ -1,98 +0,0 @@ -. */ -/* */ -/*************************************************************************************/ - -namespace Thelia\Routing\Matcher; - -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\Routing\Matcher\RequestMatcherInterface; -use Symfony\Component\Routing\Exception\ResourceNotFoundException; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; - -use Thelia\Core\Event\ActionEvent; -use Thelia\Core\Event\TheliaEvents; -use Thelia\Action\Cart; - -/** - * Matcher using action param in get or post method to perform actions. For exemple index.php?action=addCart will find the good controller that can perform this action. - * - * @author Manuel Raynaud - */ - -class ActionMatcher implements RequestMatcherInterface -{ - /** - * - * @var Symfony\Component\EventDispatcher\EventDispatcherInterface - */ - protected $dispatcher; - - public function setDispatcher(EventDispatcherInterface $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - public function matchRequest(Request $request) - { - if (false !== $action = $request->get("action")) { - //search corresponding action - return $this->dispatchAction($request, $action); - } - - throw new ResourceNotFoundException("No action parameter found"); - } - - protected function dispatchAction(Request $request, $action) - { - $controller = null; - $event = new ActionEvent($request, $action); - $this->dispatcher->dispatch(TheliaEvents::ACTION, $event); - if ($event->hasController()) { - $controller = $event->getController(); - } - -/* switch ($action) { - case 'addProduct': - $controller = array( - new Cart($this->dispatcher), - "addCart" - ); - break; - default : - $event = new ActionEvent($request, $action); - $this->dispatcher->dispatch(TheliaEvents::ACTION, $event); - if ($event->hasController()) { - $controller = $event->getController(); - } - break; - }*/ - - if ($controller) { - return array( - '_controller' => $controller - ); - } - - throw new ResourceNotFoundException("No action parameter found"); - - } -}