From 1805208f0438c7089aa1d37b7a1cd51b796063d8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 21 Mar 2011 23:25:25 +0000 Subject: [PATCH] Removed obsolete parameter 'applicationInstance' from all template engines --- .../hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php | 2 +- .../helper/hub/announcement/class_HubDescriptorHelper.php | 2 +- .../helper/hub/connection/class_HubSelfConnectHelper.php | 2 +- application/hub/main/tags/package/class_PackageTags.php | 2 +- .../announcement/class_XmlAnnouncementTemplateEngine.php | 8 +++++--- .../connect/class_XmlSelfConnectTemplateEngine.php | 8 +++++--- .../objects/class_XmlObjectRegistryTemplateEngine.php | 8 +++++--- index.php | 2 +- 8 files changed, 20 insertions(+), 14 deletions(-) diff --git a/application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php b/application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php index 35e5dda0a..442268e7c 100644 --- a/application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php +++ b/application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php @@ -111,7 +111,7 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis // Output all lines $this->debugOutput(' '); $this->debugOutput('MCrypt Cruncher v' . $this->getVersion() . ' is starting ...'); - $this->debugOutput('Copyright (c) 2011 MCrypt Cruncher Developer Team'); + $this->debugOutput('Copyright (c) 2011 Hub Developer Team'); $this->debugOutput(' '); $this->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.'); $this->debugOutput('This is free software, and you are welcome to redistribute it under certain'); diff --git a/application/hub/main/helper/hub/announcement/class_HubDescriptorHelper.php b/application/hub/main/helper/hub/announcement/class_HubDescriptorHelper.php index 6e912d0ef..f8c090366 100644 --- a/application/hub/main/helper/hub/announcement/class_HubDescriptorHelper.php +++ b/application/hub/main/helper/hub/announcement/class_HubDescriptorHelper.php @@ -72,7 +72,7 @@ class HubDescriptorHelper extends BaseHubHelper implements HelpableHub { $applicationInstance = Registry::getRegistry()->getInstance('app'); // Get a XML template instance - $templateInstance = ObjectFactory::createObjectByConfiguredName('node_announcement_template_class', array($applicationInstance)); + $templateInstance = ObjectFactory::createObjectByConfiguredName('node_announcement_template_class'); // Disable language support $templateInstance->enableLanguageSupport(false); diff --git a/application/hub/main/helper/hub/connection/class_HubSelfConnectHelper.php b/application/hub/main/helper/hub/connection/class_HubSelfConnectHelper.php index 9711cb002..552e031a0 100644 --- a/application/hub/main/helper/hub/connection/class_HubSelfConnectHelper.php +++ b/application/hub/main/helper/hub/connection/class_HubSelfConnectHelper.php @@ -71,7 +71,7 @@ class HubSelfConnectHelper extends BaseHubHelper implements HelpableHub { $applicationInstance = Registry::getRegistry()->getInstance('app'); // Get a XML template instance - $templateInstance = ObjectFactory::createObjectByConfiguredName('node_self_connect_template_class', array($applicationInstance)); + $templateInstance = ObjectFactory::createObjectByConfiguredName('node_self_connect_template_class'); // Disable language support $templateInstance->enableLanguageSupport(false); diff --git a/application/hub/main/tags/package/class_PackageTags.php b/application/hub/main/tags/package/class_PackageTags.php index be54b5765..c809c4176 100644 --- a/application/hub/main/tags/package/class_PackageTags.php +++ b/application/hub/main/tags/package/class_PackageTags.php @@ -74,7 +74,7 @@ class PackageTags extends BaseTags implements Tagable { $applicationInstance = Registry::getRegistry()->getInstance('app'); // Get a XML template instance - $templateInstance = ObjectFactory::createObjectByConfiguredName('node_object_registry_template_class', array($applicationInstance)); + $templateInstance = ObjectFactory::createObjectByConfiguredName('node_object_registry_template_class'); // Disable language support $templateInstance->enableLanguageSupport(false); diff --git a/application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php b/application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php index f4a066fd9..7e952d8b2 100644 --- a/application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php +++ b/application/hub/main/template/announcement/class_XmlAnnouncementTemplateEngine.php @@ -69,7 +69,6 @@ class XmlAnnouncementTemplateEngine extends BaseTemplateEngine implements Compil /** * Creates an instance of the class TemplateEngine and prepares it for usage * - * @param $applicationInstance A manageable application * @return $templateInstance An instance of TemplateEngine * @throws BasePathIsEmptyException If the provided $templateBasePath is empty * @throws InvalidBasePathStringException If $templateBasePath is no string @@ -78,10 +77,13 @@ class XmlAnnouncementTemplateEngine extends BaseTemplateEngine implements Compil * @throws BasePathReadProtectedException If $templateBasePath is * read-protected */ - public static final function createXmlAnnouncementTemplateEngine (ManageableApplication $applicationInstance) { + public static final function createXmlAnnouncementTemplateEngine () { // Get a new instance $templateInstance = new XmlAnnouncementTemplateEngine(); + // Get the application instance from registry + $applicationInstance = Registry::getRegistry()->getInstance('app'); + // Determine base path $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; @@ -270,7 +272,7 @@ class XmlAnnouncementTemplateEngine extends BaseTemplateEngine implements Compil // Is the template dependency set? if ((!empty($templateDependency)) && (!isset($this->dependencyContent[$node]))) { // Get a temporay template instance - $templateInstance = ObjectFactory::createObjectByConfiguredName('node_announcement_template_class', array($this->getApplicationInstance())); + $templateInstance = ObjectFactory::createObjectByConfiguredName('node_announcement_template_class'); // Then load it $templateInstance->loadAnnouncementTemplate($templateDependency); diff --git a/application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php b/application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php index df6cdd09b..ccb4a84c5 100644 --- a/application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php +++ b/application/hub/main/template/connect/class_XmlSelfConnectTemplateEngine.php @@ -62,7 +62,6 @@ class XmlSelfConnectTemplateEngine extends BaseTemplateEngine implements Compile /** * Creates an instance of the class TemplateEngine and prepares it for usage * - * @param $applicationInstance A manageable application * @return $templateInstance An instance of TemplateEngine * @throws BasePathIsEmptyException If the provided $templateBasePath is empty * @throws InvalidBasePathStringException If $templateBasePath is no string @@ -71,10 +70,13 @@ class XmlSelfConnectTemplateEngine extends BaseTemplateEngine implements Compile * @throws BasePathReadProtectedException If $templateBasePath is * read-protected */ - public static final function createXmlSelfConnectTemplateEngine (ManageableApplication $applicationInstance) { + public static final function createXmlSelfConnectTemplateEngine () { // Get a new instance $templateInstance = new XmlSelfConnectTemplateEngine(); + // Get the application instance from registry + $applicationInstance = Registry::getRegistry()->getInstance('app'); + // Determine base path $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; @@ -263,7 +265,7 @@ class XmlSelfConnectTemplateEngine extends BaseTemplateEngine implements Compile // Is the template dependency set? if ((!empty($templateDependency)) && (!isset($this->dependencyContent[$node]))) { // Get a temporay template instance - $templateInstance = ObjectFactory::createObjectByConfiguredName('node_self_connect_template_class', array($this->getApplicationInstance())); + $templateInstance = ObjectFactory::createObjectByConfiguredName('node_self_connect_template_class'); // Then load it $templateInstance->loadSelfConnectTemplate($templateDependency); diff --git a/application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php b/application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php index 438565cd4..81b5cba74 100644 --- a/application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php +++ b/application/hub/main/template/objects/class_XmlObjectRegistryTemplateEngine.php @@ -74,7 +74,6 @@ class XmlObjectRegistryTemplateEngine extends BaseTemplateEngine implements Comp /** * Creates an instance of the class TemplateEngine and prepares it for usage * - * @param $applicationInstance A manageable application * @return $templateInstance An instance of TemplateEngine * @throws BasePathIsEmptyException If the provided $templateBasePath is empty * @throws InvalidBasePathStringException If $templateBasePath is no string @@ -83,10 +82,13 @@ class XmlObjectRegistryTemplateEngine extends BaseTemplateEngine implements Comp * @throws BasePathReadProtectedException If $templateBasePath is * read-protected */ - public static final function createXmlObjectRegistryTemplateEngine (ManageableApplication $applicationInstance) { + public static final function createXmlObjectRegistryTemplateEngine () { // Get a new instance $templateInstance = new XmlObjectRegistryTemplateEngine(); + // Get the application instance from registry + $applicationInstance = Registry::getRegistry()->getInstance('app'); + // Determine base path $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; @@ -282,7 +284,7 @@ class XmlObjectRegistryTemplateEngine extends BaseTemplateEngine implements Comp // Is the template dependency set? if ((!empty($templateDependency)) && (!isset($this->dependencyContent[$node]))) { // Get a temporay template instance - $templateInstance = ObjectFactory::createObjectByConfiguredName('node_object_registry_template_class', array($this->getApplicationInstance())); + $templateInstance = ObjectFactory::createObjectByConfiguredName('node_object_registry_template_class'); // Then load it $templateInstance->loadObjectRegistryTemplate($templateDependency); diff --git a/index.php b/index.php index f374e7e34..050f99828 100644 --- a/index.php +++ b/index.php @@ -98,7 +98,7 @@ final class ApplicationEntryPoint { // Use the template engine for putting out (nicer look) the message try { // Get the template instance from our object factory - $templateInstance = ObjectFactory::createObjectByName($tpl, array(ApplicationHelper::getInstance())); + $templateInstance = ObjectFactory::createObjectByName($tpl); } catch (FrameworkException $e) { die(sprintf("[Main:] Could not initialize template engine for reason: %s", $e->getMessage() -- 2.39.2