From 1aaab031fcb7c4a2272803a749521ee98e177c3e Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 19 Apr 2013 16:41:11 +0200 Subject: [PATCH] create admin route --- .../Thelia/Config/Resources/admin_routing.xml | 10 ++++++++ .../Thelia/{ => Config/Resources}/config.xml | 23 +++++++++++++++++++ core/lib/Thelia/Config/Resources/routing.xml | 8 +++++++ core/lib/Thelia/Core/Thelia.php | 18 +++++++++++++-- 4 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 core/lib/Thelia/Config/Resources/admin_routing.xml rename core/lib/Thelia/{ => Config/Resources}/config.xml (81%) create mode 100644 core/lib/Thelia/Config/Resources/routing.xml diff --git a/core/lib/Thelia/Config/Resources/admin_routing.xml b/core/lib/Thelia/Config/Resources/admin_routing.xml new file mode 100644 index 000000000..d2182ef50 --- /dev/null +++ b/core/lib/Thelia/Config/Resources/admin_routing.xml @@ -0,0 +1,10 @@ + + + + + + Thelia\Controller\Admin + + \ No newline at end of file diff --git a/core/lib/Thelia/config.xml b/core/lib/Thelia/Config/Resources/config.xml similarity index 81% rename from core/lib/Thelia/config.xml rename to core/lib/Thelia/Config/Resources/config.xml index 4e9132f34..2e4304ed5 100644 --- a/core/lib/Thelia/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -17,6 +17,7 @@ Thelia\Routing\NullUrlGenerator Symfony\Cmf\Component\Routing\DynamicRouter Symfony\Cmf\Component\Routing\ChainRouter + Symfony\Component\Routing\Router @@ -44,6 +45,24 @@ + + %thelia.core_dir%/Config/Resources/ + + + + + + + + + routing.xml + + %kernel.cache_dir% + %kernel.debug% + + + + @@ -52,6 +71,10 @@ -255 + + + 0 + diff --git a/core/lib/Thelia/Config/Resources/routing.xml b/core/lib/Thelia/Config/Resources/routing.xml new file mode 100644 index 000000000..95dbfb17b --- /dev/null +++ b/core/lib/Thelia/Config/Resources/routing.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/core/lib/Thelia/Core/Thelia.php b/core/lib/Thelia/Core/Thelia.php index 03ff5324d..1860af69c 100644 --- a/core/lib/Thelia/Core/Thelia.php +++ b/core/lib/Thelia/Core/Thelia.php @@ -105,7 +105,7 @@ class Thelia extends Kernel protected function loadConfiguration(ContainerBuilder $container) { - $loader = new XmlFileLoader($container, new FileLocator(THELIA_ROOT . "/core/lib/Thelia")); + $loader = new XmlFileLoader($container, new FileLocator(THELIA_ROOT . "/core/lib/Thelia/Config/Resources")); $loader->load("config.xml"); $modules = \Thelia\Model\ModuleQuery::getActivated(); @@ -153,7 +153,6 @@ class Thelia extends Kernel $this->loadConfiguration($container); $container->customCompile(); - return $container; } @@ -190,6 +189,21 @@ class Thelia extends Kernel } } + /** + * Returns the kernel parameters. + * + * @return array An array of kernel parameters + */ + protected function getKernelParameters() + { + $parameters = parent::getKernelParameters(); + + $parameters["thelia.root_dir"] = THELIA_ROOT; + $parameters["thelia.core_dir"] = THELIA_ROOT . "core/lib/Thelia"; + + return $parameters; + } + /** * return available bundle *