From 3a415d1123eb3bef664dc4910dd7acfbfd4438c8 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 13 Mar 2013 19:51:07 +0100 Subject: [PATCH] parser --- composer.lock | 96 ++++++++++---------- core/lib/Thelia/Core/Bundle/TheliaBundle.php | 2 - core/lib/Thelia/Core/Template/Parser.php | 13 +-- core/lib/Thelia/Tpex | 2 +- templates/default/index.html | 30 +++++- 5 files changed, 84 insertions(+), 59 deletions(-) diff --git a/composer.lock b/composer.lock index 35a1e4b1e..52e38bb76 100644 --- a/composer.lock +++ b/composer.lock @@ -192,17 +192,17 @@ }, { "name": "symfony/class-loader", - "version": "v2.1.7", + "version": "v2.1.8", "target-dir": "Symfony/Component/ClassLoader", "source": { "type": "git", - "url": "https://github.com/symfony/ClassLoader", - "reference": "v2.1.7" + "url": "https://github.com/symfony/ClassLoader.git", + "reference": "v2.1.8" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/ClassLoader/archive/v2.1.7.zip", - "reference": "v2.1.7", + "url": "https://api.github.com/repos/symfony/ClassLoader/zipball/v2.1.8", + "reference": "v2.1.8", "shasum": "" }, "require": { @@ -211,7 +211,7 @@ "require-dev": { "symfony/finder": "2.1.*" }, - "time": "2013-01-09 08:51:07", + "time": "2013-01-26 07:21:53", "type": "library", "autoload": { "psr-0": { @@ -237,17 +237,17 @@ }, { "name": "symfony/config", - "version": "v2.1.7", + "version": "v2.1.8", "target-dir": "Symfony/Component/Config", "source": { "type": "git", - "url": "https://github.com/symfony/Config", - "reference": "v2.1.7" + "url": "https://github.com/symfony/Config.git", + "reference": "v2.1.8" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/Config/archive/v2.1.7.zip", - "reference": "v2.1.7", + "url": "https://api.github.com/repos/symfony/Config/zipball/v2.1.8", + "reference": "v2.1.8", "shasum": "" }, "require": { @@ -279,17 +279,17 @@ }, { "name": "symfony/console", - "version": "v2.1.7", + "version": "v2.1.8", "target-dir": "Symfony/Component/Console", "source": { "type": "git", - "url": "https://github.com/symfony/Console", - "reference": "v2.1.7" + "url": "https://github.com/symfony/Console.git", + "reference": "v2.1.8" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/Console/archive/v2.1.7.zip", - "reference": "v2.1.7", + "url": "https://api.github.com/repos/symfony/Console/zipball/v2.1.8", + "reference": "v2.1.8", "shasum": "" }, "require": { @@ -321,17 +321,17 @@ }, { "name": "symfony/dependency-injection", - "version": "v2.1.7", + "version": "v2.1.8", "target-dir": "Symfony/Component/DependencyInjection", "source": { "type": "git", - "url": "https://github.com/symfony/DependencyInjection", - "reference": "v2.1.7" + "url": "https://github.com/symfony/DependencyInjection.git", + "reference": "v2.1.8" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/DependencyInjection/archive/v2.1.7.zip", - "reference": "v2.1.7", + "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/v2.1.8", + "reference": "v2.1.8", "shasum": "" }, "require": { @@ -345,7 +345,7 @@ "symfony/config": "2.1.*", "symfony/yaml": "2.1.*" }, - "time": "2013-01-17 21:21:51", + "time": "2013-02-11 11:42:49", "type": "library", "autoload": { "psr-0": { @@ -371,17 +371,17 @@ }, { "name": "symfony/event-dispatcher", - "version": "v2.1.7", + "version": "v2.1.8", "target-dir": "Symfony/Component/EventDispatcher", "source": { "type": "git", - "url": "https://github.com/symfony/EventDispatcher", - "reference": "v2.1.7" + "url": "https://github.com/symfony/EventDispatcher.git", + "reference": "v2.1.8" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/EventDispatcher/archive/v2.1.7.zip", - "reference": "v2.1.7", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/v2.1.8", + "reference": "v2.1.8", "shasum": "" }, "require": { @@ -394,7 +394,7 @@ "symfony/dependency-injection": "2.1.*", "symfony/http-kernel": "2.1.*" }, - "time": "2013-01-11 00:31:43", + "time": "2013-02-11 11:26:14", "type": "library", "autoload": { "psr-0": { @@ -420,23 +420,23 @@ }, { "name": "symfony/http-foundation", - "version": "v2.1.7", + "version": "v2.1.8", "target-dir": "Symfony/Component/HttpFoundation", "source": { "type": "git", - "url": "https://github.com/symfony/HttpFoundation", - "reference": "v2.1.7" + "url": "https://github.com/symfony/HttpFoundation.git", + "reference": "v2.1.8" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/HttpFoundation/archive/v2.1.7.zip", - "reference": "v2.1.7", + "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/v2.1.8", + "reference": "v2.1.8", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2013-01-11 00:31:43", + "time": "2013-02-22 18:02:22", "type": "library", "autoload": { "psr-0": { @@ -463,17 +463,17 @@ }, { "name": "symfony/http-kernel", - "version": "v2.1.7", + "version": "v2.1.8", "target-dir": "Symfony/Component/HttpKernel", "source": { "type": "git", - "url": "https://github.com/symfony/HttpKernel", - "reference": "v2.1.7" + "url": "https://github.com/symfony/HttpKernel.git", + "reference": "v2.1.8" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/HttpKernel/archive/v2.1.7.zip", - "reference": "v2.1.7", + "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/v2.1.8", + "reference": "v2.1.8", "shasum": "" }, "require": { @@ -499,7 +499,7 @@ "symfony/dependency-injection": "2.1.*", "symfony/finder": "2.1.*" }, - "time": "2013-01-17 16:21:47", + "time": "2013-02-23 21:28:36", "type": "library", "autoload": { "psr-0": { @@ -525,34 +525,34 @@ }, { "name": "symfony/routing", - "version": "v2.1.7", + "version": "v2.1.8", "target-dir": "Symfony/Component/Routing", "source": { "type": "git", - "url": "https://github.com/symfony/Routing", - "reference": "v2.1.7" + "url": "https://github.com/symfony/Routing.git", + "reference": "v2.1.8" }, "dist": { "type": "zip", - "url": "https://github.com/symfony/Routing/archive/v2.1.7.zip", - "reference": "v2.1.7", + "url": "https://api.github.com/repos/symfony/Routing/zipball/v2.1.8", + "reference": "v2.1.8", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "doctrine/common": ">=2.2,<2.4-dev", + "doctrine/common": ">=2.2,<3.0", "symfony/config": "2.1.*", "symfony/http-kernel": "2.1.*", "symfony/yaml": "2.1.*" }, "suggest": { - "doctrine/common": ">=2.2,<2.4-dev", + "doctrine/common": "~2.2", "symfony/config": "2.1.*", "symfony/yaml": "2.1.*" }, - "time": "2013-01-09 08:51:07", + "time": "2013-02-22 18:53:49", "type": "library", "autoload": { "psr-0": { diff --git a/core/lib/Thelia/Core/Bundle/TheliaBundle.php b/core/lib/Thelia/Core/Bundle/TheliaBundle.php index 1d95ffb6f..50d542efc 100644 --- a/core/lib/Thelia/Core/Bundle/TheliaBundle.php +++ b/core/lib/Thelia/Core/Bundle/TheliaBundle.php @@ -69,11 +69,9 @@ 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 e6fe2b678..e25606df6 100644 --- a/core/lib/Thelia/Core/Template/Parser.php +++ b/core/lib/Thelia/Core/Template/Parser.php @@ -75,10 +75,9 @@ class Parser implements ParserInterface * * public function __construct(ContainerBuilder $container) */ - public function __construct(ContainerInterface $container, Tpex $tpex) + public function __construct(ContainerInterface $container) { $this->container = $container; - $this->tpex = $tpex; } /** @@ -148,16 +147,18 @@ class Parser implements ParserInterface public function loadParser() { $content = $this->openFile($this->getRequest()); - - $this->tpex->init($this->container->get("request"), $this->container->get("dispatcher"), $content, THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/"); - $this->tpex->configure( + + $tpex = new Tpex(); + + $tpex->init($this->container->get("request"), $this->container->get("dispatcher"), $content, THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/"); + $tpex->configure( array(), array(), array( "secure" => "Thelia\Core\Template\BaseParam\Secure" ) ); - $this->setContent($this->tpex->execute()); + $this->setContent($tpex->execute()); } protected function openFile(Request $request) diff --git a/core/lib/Thelia/Tpex b/core/lib/Thelia/Tpex index 3830a5619..b591fc524 160000 --- a/core/lib/Thelia/Tpex +++ b/core/lib/Thelia/Tpex @@ -1 +1 @@ -Subproject commit 3830a561978a08b77fa34da096bcc0b5dddf0718 +Subproject commit b591fc524df0982852f1bef74d2b3d00ae541ed7 diff --git a/templates/default/index.html b/templates/default/index.html index f3da716a9..f20b45142 100644 --- a/templates/default/index.html +++ b/templates/default/index.html @@ -5,8 +5,34 @@ -
TODO write content - #INCLUDE "include1.html" +
TODO write content #SET{toto, 4} toto vaut #GET{toto} zeafazefaze azef azef azef azef + + #TOTO + + #ALFRED azd azd azed azd + #CHAPOle chapo est vide + + + + avant boucle + + #FU + + UNEVARIABLE vaut zéro + + UNEVARIABLE ne vaut pas zéro + + + après boucle + + après boucle vide + + + + Compteur = #INDEX
+
+ +