From 5c0f6779aa2784fcbc68ff002a515a13dc496813 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 19 Jun 2013 12:15:07 +0200 Subject: [PATCH 1/3] remove unused code --- .../Compiler/RegisterSmartyPluginPass.php | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterSmartyPluginPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterSmartyPluginPass.php index cc3608641..ccf1f8d9b 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterSmartyPluginPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterSmartyPluginPass.php @@ -35,30 +35,6 @@ class RegisterSmartyPluginPass implements CompilerPassInterface { $smarty->addMethodCall("addPlugins", array(new Reference($id))); - /*$register_plugin = $container->get($id); - - $reflectionObject = new \ReflectionObject($register_plugin); - $interface = "Thelia\Core\Template\Smarty\SmartyPluginInterface"; - if (!$reflectionObject->implementsInterface($interface)) { - throw new \RuntimeException(sprintf("%s class must implement %s interface",$reflectionObject->getName(), $interface)); - } - - $plugins = $register_plugin->registerPlugins(); - - if(!is_array($plugins)) { - $plugins = array($plugins); - } - - foreach($plugins as $plugin) { - $smarty->addMethodCall("registerPlugin", array( - $plugin->type, - $plugin->name, - array( - $plugin->class, - $plugin->method - ) - )); - }*/ } $smarty->addMethodCall("registerPlugins"); From e81659553518672b963e5e355f773859c40ac42f Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 19 Jun 2013 12:19:26 +0200 Subject: [PATCH 2/3] fix typo --- .../Admin/Controller/BaseAdminController.php | 2 +- .../Compiler/RegisterSmartyPluginPass.php | 28 ++++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/core/lib/Thelia/Admin/Controller/BaseAdminController.php b/core/lib/Thelia/Admin/Controller/BaseAdminController.php index deca35d33..eaee6ee39 100644 --- a/core/lib/Thelia/Admin/Controller/BaseAdminController.php +++ b/core/lib/Thelia/Admin/Controller/BaseAdminController.php @@ -45,7 +45,7 @@ class BaseAdminController $this->parser = $parser; - // FIXME: should be red from config + // FIXME: should be read from config $this->parser->setTemplate('admin/default'); } diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterSmartyPluginPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterSmartyPluginPass.php index ccf1f8d9b..edb979bc6 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterSmartyPluginPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterSmartyPluginPass.php @@ -1,11 +1,25 @@ . */ +/* */ +/*************************************************************************************/ namespace Thelia\Core\DependencyInjection\Compiler; From 6e3fb9aababa451633c87538becd0ab718bbd54b Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 19 Jun 2013 16:21:15 +0200 Subject: [PATCH 3/3] add some phpdoc --- .../Compiler/RegisterSmartyPluginPass.php | 8 ++++ .../Core/Template/Assets/AsseticManager.php | 38 +++++++++---------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterSmartyPluginPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterSmartyPluginPass.php index edb979bc6..0de6ab1bb 100644 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterSmartyPluginPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterSmartyPluginPass.php @@ -28,6 +28,14 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; +/** + * + * This compiler allow adding plugins in smarty parser using config files + * + * Class RegisterSmartyPluginPass + * @package Thelia\Core\DependencyInjection\Compiler + */ + class RegisterSmartyPluginPass implements CompilerPassInterface { /** diff --git a/core/lib/Thelia/Core/Template/Assets/AsseticManager.php b/core/lib/Thelia/Core/Template/Assets/AsseticManager.php index b58624b37..8f8df9698 100644 --- a/core/lib/Thelia/Core/Template/Assets/AsseticManager.php +++ b/core/lib/Thelia/Core/Template/Assets/AsseticManager.php @@ -1,24 +1,24 @@ . */ -/* */ +/* */ +/* Thelia */ +/* */ +/* Copyright (c) OpenStudio */ +/* email : info@thelia.net */ +/* web : http://www.thelia.net */ +/* */ +/* This program is free software; you can redistribute it and/or modify */ +/* it under the terms of the GNU General Public License as published by */ +/* the Free Software Foundation; either version 3 of the License */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program. If not, see . */ +/* */ /*************************************************************************************/ namespace Thelia\Core\Template\Assets;