diff --git a/composer.lock b/composer.lock index b73dca4f4..73c623aad 100644 --- a/composer.lock +++ b/composer.lock @@ -4,18 +4,23 @@ { "name": "Thelia/Tpex", "version": "dev-master", + "target-dir": "Thelia/Tpex", "source": { "type": "git", "url": "https://github.com/thelia/Tpex.git", - "reference": "a19b49de4c2eb1c759646a9d7d4caf5e00825f67" + "reference": "1be74fd835d6e08b5c4500d7720945412195495e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thelia/Tpex/zipball/a19b49de4c2eb1c759646a9d7d4caf5e00825f67", - "reference": "a19b49de4c2eb1c759646a9d7d4caf5e00825f67", + "url": "https://api.github.com/repos/thelia/Tpex/zipball/1be74fd835d6e08b5c4500d7720945412195495e", + "reference": "1be74fd835d6e08b5c4500d7720945412195495e", "shasum": "" }, - "time": "2013-02-18 20:38:40", + "require": { + "symfony/event-dispatcher": "2.1.*", + "symfony/http-foundation": "2.1.*" + }, + "time": "2013-02-18 21:44:38", "type": "library", "autoload": { "psr-0": { diff --git a/core/lib/Thelia/Core/Bundle/TheliaBundle.php b/core/lib/Thelia/Core/Bundle/TheliaBundle.php index 35f735434..1d95ffb6f 100644 --- a/core/lib/Thelia/Core/Bundle/TheliaBundle.php +++ b/core/lib/Thelia/Core/Bundle/TheliaBundle.php @@ -69,8 +69,11 @@ class TheliaBundle extends Bundle $container->register('resolver', 'Symfony\Component\HttpKernel\Controller\ControllerResolver'); + $container->register('tpex', 'Thelia\Tpex\Tpex'); + $container->register('parser','Thelia\Core\Template\Parser') ->addArgument(new Reference('service_container')) + ->addArgument(new Reference('tpex')) ; /** * RouterListener implements EventSubscriberInterface and listen for kernel.request event diff --git a/core/lib/Thelia/Core/Template/Parser.php b/core/lib/Thelia/Core/Template/Parser.php index 5469c68ac..cd5a9f652 100644 --- a/core/lib/Thelia/Core/Template/Parser.php +++ b/core/lib/Thelia/Core/Template/Parser.php @@ -29,6 +29,8 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Symfony\Component\Config\ConfigCache; +use Thelia\Tpex\Tpex; + /** * * Master class of Thelia's parser. The loop mechanism depends of this parser @@ -58,6 +60,8 @@ class Parser implements ParserInterface protected $content; protected $status = 200; + protected $tpex; + protected $template = "default"; protected $init = false; @@ -68,9 +72,10 @@ class Parser implements ParserInterface * * public function __construct(ContainerBuilder $container) */ - public function __construct(ContainerInterface $container) + public function __construct(ContainerInterface $container, Tpex $tpex) { $this->container = $container; + $this->tpex = $tpex; } protected function initialize() @@ -164,7 +169,11 @@ class Parser implements ParserInterface { $content = $this->openFile($this->getRequest()); - $content = $this->parseInclude($content); + $this->tpex->setContent($content); + $this->tpex->setDispatcher($this->container->get("dispatcher")); + $this->tpex->setRequest($this->container->get("request")); + + $this->tpex->execute(); } protected function openFile(Request $request) diff --git a/install/insert.sql b/install/insert.sql index 55314e170..6d449f73e 100644 --- a/install/insert.sql +++ b/install/insert.sql @@ -2,4 +2,7 @@ INSERT INTO `lang`(`id`,`title`,`code`,`locale`,`url`,`by_default`,`created_at`, (1, 'Français', 'fr', 'fr_FR', '','1', NOW(), NOW()), (2, 'English', 'en', 'en_EN', '', '0', NOW(), NOW()), (3, 'Espanol', 'es', 'es_ES', '', '0', NOW(), NOW()), -(4, 'Italiano', 'it', 'it_IT', '','0', NOW(), NOW()); \ No newline at end of file +(4, 'Italiano', 'it', 'it_IT', '','0', NOW(), NOW()); + +INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES +('session_config.default', '1', 1, 1, NOW(), NOW()); \ No newline at end of file