From 266e0bd5ebbc0dc50f52dbcced9c094785b0e8ef Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 8 Apr 2013 17:06:04 +0200 Subject: [PATCH] change Tpex integration --- composer.json | 1 + composer.lock | 57 +++++++++++++++++++++--- core/lib/Thelia/Core/Template/Parser.php | 12 ++--- core/lib/Thelia/Tpex | 2 +- core/lib/Thelia/config.xml | 17 +++++++ 5 files changed, 74 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 7fd8f08d5..5763d5345 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ }, "require":{ "php": ">=5.4.0", + "ezyang/htmlpurifier": "dev-master", "ircmaxell/password-compat": "dev-master", "propel/propel1" : "1.6.*", "psr/log" : "1.0", diff --git a/composer.lock b/composer.lock index d171735aa..8b32f8141 100644 --- a/composer.lock +++ b/composer.lock @@ -1,6 +1,50 @@ { - "hash": "89f5db06d70dd16aa1ba0f4983c89335", + "hash": "b0cd7b00eccd6c31a028d4536d822017", "packages": [ + { + "name": "ezyang/htmlpurifier", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "v4.5.0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/v4.5.0", + "reference": "v4.5.0", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "HTMLPurifier": "library/" + }, + "files": [ + "library/HTMLPurifier.composer.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ], + "time": "2013-02-18 00:04:08" + }, { "name": "ircmaxell/password-compat", "version": "dev-master", @@ -94,16 +138,16 @@ }, { "name": "propel/propel1", - "version": "1.6.8", + "version": "1.6.9", "source": { "type": "git", "url": "https://github.com/propelorm/Propel.git", - "reference": "1.6.8" + "reference": "1.6.9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/propelorm/Propel/zipball/1.6.8", - "reference": "1.6.8", + "url": "https://api.github.com/repos/propelorm/Propel/zipball/1.6.9", + "reference": "1.6.9", "shasum": "" }, "require": { @@ -150,7 +194,7 @@ "orm", "persistence" ], - "time": "2013-02-14 20:50:27" + "time": "2013-03-31 17:20:51" }, { "name": "psr/log", @@ -676,6 +720,7 @@ ], "minimum-stability": "stable", "stability-flags": { + "ezyang/htmlpurifier": 20, "ircmaxell/password-compat": 20 }, "platform": { diff --git a/core/lib/Thelia/Core/Template/Parser.php b/core/lib/Thelia/Core/Template/Parser.php index 1a4d3c8be..bf47caa40 100644 --- a/core/lib/Thelia/Core/Template/Parser.php +++ b/core/lib/Thelia/Core/Template/Parser.php @@ -148,15 +148,11 @@ class Parser implements ParserInterface { $content = $this->openFile($this->getRequest()); - $tpex = new Tpex(); + $tpex = $this->container->get("template"); + + $tpex->setBaseDir(THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/"); + $tpex->setContent($content); - $tpex->init($this->container->get("request"), $this->container->get("event_dispatcher"), $content, THELIA_TEMPLATE_DIR . rtrim($this->template, "/") . "/"); - $tpex->configure( - $this->container->getParameter("Tpex.loop"), - $this->container->getParameter("Tpex.filter"), - $this->container->getParameter("Tpex.baseParam"), - $this->container->getParameter("Tpex.testLoop") - ); $this->setContent($tpex->execute()); } diff --git a/core/lib/Thelia/Tpex b/core/lib/Thelia/Tpex index ce3cc65f6..a674fe8c6 160000 --- a/core/lib/Thelia/Tpex +++ b/core/lib/Thelia/Tpex @@ -1 +1 @@ -Subproject commit ce3cc65f6ebf1a9a33c10f8683d3fbc7fe5733ac +Subproject commit a674fe8c61f2cef2db71e9bf85e3ab9b2c377bec diff --git a/core/lib/Thelia/config.xml b/core/lib/Thelia/config.xml index e3ae73f70..4126b9512 100644 --- a/core/lib/Thelia/config.xml +++ b/core/lib/Thelia/config.xml @@ -62,6 +62,23 @@ + + + + + %tpex.loop% + + + %tpex.filter% + + + %tpex.baseParam% + + + %tpex.testLoop% + + +