From e234132559c36b0d790f88f738b056f6e2c3f114 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 22 May 2017 20:42:34 +0200 Subject: [PATCH] Continued: - no more 'base_path', was to unflexible and horribly wrong. Now there are 3 configuration entries: MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 'root_base_path' - Where index.php has been found 'framework_base_path' - Where the framework is located 'application_base_path' - Where the applications are located (without application name) - imported FileNotFoundException - imported DhtObjectFactory - updated core framework Signed-off-by: Roland Häder --- .../class_NodeAnnouncementAnswerOkayHandler.php | 1 + .../class_RequestNodeListAnswerOkayHandler.php | 1 + .../message-types/class_BaseMessageHandler.php | 1 + .../class_NodeMessageRequestNodeListHandler.php | 1 + .../urls/class_CrawlerUploadedListUrlSource.php | 2 +- .../classes/states/dht/init/class_DhtInitState.php | 1 + .../states/dht/virgin/class_DhtVirginState.php | 1 + .../template/class_BaseXmlTemplateEngine.php | 13 ++++++++----- core | 2 +- index.php | 1 + 10 files changed, 17 insertions(+), 7 deletions(-) diff --git a/application/hub/classes/handler/answer-status/announcement/class_NodeAnnouncementAnswerOkayHandler.php b/application/hub/classes/handler/answer-status/announcement/class_NodeAnnouncementAnswerOkayHandler.php index a55714d15..fae30321d 100644 --- a/application/hub/classes/handler/answer-status/announcement/class_NodeAnnouncementAnswerOkayHandler.php +++ b/application/hub/classes/handler/answer-status/announcement/class_NodeAnnouncementAnswerOkayHandler.php @@ -4,6 +4,7 @@ namespace Hub\Handler\Node\Announcement\Answer; // Import application-specific stuff use Hub\Database\Frontend\Node\Dht\NodeDistributedHashTableDatabaseWrapper; +use Hub\Factory\Dht\DhtObjectFactory; use Hub\Factory\Node\NodeObjectFactory; use Hub\Network\Receive\Receivable; use Hub\Node\BaseHubNode; diff --git a/application/hub/classes/handler/answer-status/requests/class_RequestNodeListAnswerOkayHandler.php b/application/hub/classes/handler/answer-status/requests/class_RequestNodeListAnswerOkayHandler.php index 3199bb5d2..f3c4a47a3 100644 --- a/application/hub/classes/handler/answer-status/requests/class_RequestNodeListAnswerOkayHandler.php +++ b/application/hub/classes/handler/answer-status/requests/class_RequestNodeListAnswerOkayHandler.php @@ -3,6 +3,7 @@ namespace Hub\Handler\Answer\Okay\NodeList; // Import application-specific stuff +use Hub\Factory\Dht\DhtObjectFactory; use Hub\Network\Receive\Receivable; // Import framework stuff diff --git a/application/hub/classes/handler/message-types/class_BaseMessageHandler.php b/application/hub/classes/handler/message-types/class_BaseMessageHandler.php index f9038c8ff..e2dee462e 100644 --- a/application/hub/classes/handler/message-types/class_BaseMessageHandler.php +++ b/application/hub/classes/handler/message-types/class_BaseMessageHandler.php @@ -3,6 +3,7 @@ namespace Hub\Handler\Message; // Import hub-specific stuff +use Hub\Factory\Dht\DhtObjectFactory; use Hub\Generic\BaseHubSystem; use Hub\Network\Receive\Receivable; diff --git a/application/hub/classes/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php b/application/hub/classes/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php index 1cefd96e5..e74527a67 100644 --- a/application/hub/classes/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php +++ b/application/hub/classes/handler/message-types/requests/class_NodeMessageRequestNodeListHandler.php @@ -4,6 +4,7 @@ namespace Hub\Handler\Node\Message\Request\NodeList; // Import application-specific stuff use Hub\Database\Frontend\Node\Dht\NodeDistributedHashTableDatabaseWrapper; +use Hub\Factory\Dht\DhtObjectFactory; use Hub\Factory\Node\NodeObjectFactory; use Hub\Network\Receive\Receivable; use Hub\Node\BaseHubNode; diff --git a/application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php b/application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php index 51b8e2875..252b7c0ee 100644 --- a/application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php +++ b/application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php @@ -83,7 +83,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R parent::__construct(__CLASS__); // "Cache" CSV path for faster usage - $this->csvFilePath = $this->getConfigInstance()->getConfigEntry('base_path') . '/' . $this->getConfigInstance()->getConfigEntry('crawler_csv_file_path'); + $this->csvFilePath = $this->getConfigInstance()->getConfigEntry('root_base_path') . '/' . $this->getConfigInstance()->getConfigEntry('crawler_csv_file_path'); // Initialize directory instance $directoryInstance = ObjectFactory::createObjectByConfiguredName('directory_class', array($this->csvFilePath)); diff --git a/application/hub/classes/states/dht/init/class_DhtInitState.php b/application/hub/classes/states/dht/init/class_DhtInitState.php index 02a0690ac..107821756 100644 --- a/application/hub/classes/states/dht/init/class_DhtInitState.php +++ b/application/hub/classes/states/dht/init/class_DhtInitState.php @@ -4,6 +4,7 @@ namespace Hub\State\Dht; // Import application-specific stuff use Hub\Dht\Distributable; +use Hub\Factory\Dht\DhtObjectFactory; use Hub\Factory\State\Dht\DhtStateFactory; // Import framework stuff diff --git a/application/hub/classes/states/dht/virgin/class_DhtVirginState.php b/application/hub/classes/states/dht/virgin/class_DhtVirginState.php index 322c17f79..a80a70e82 100644 --- a/application/hub/classes/states/dht/virgin/class_DhtVirginState.php +++ b/application/hub/classes/states/dht/virgin/class_DhtVirginState.php @@ -4,6 +4,7 @@ namespace Hub\State\Dht; // Import application-specific stuff use Hub\Dht\Distributable; +use Hub\Factory\Dht\DhtObjectFactory; use Hub\Factory\State\Dht\DhtStateFactory; // Import framework stuff diff --git a/application/hub/classes/template/class_BaseXmlTemplateEngine.php b/application/hub/classes/template/class_BaseXmlTemplateEngine.php index 04dbe4613..22e3c5282 100644 --- a/application/hub/classes/template/class_BaseXmlTemplateEngine.php +++ b/application/hub/classes/template/class_BaseXmlTemplateEngine.php @@ -93,6 +93,10 @@ class BaseXmlTemplateEngine extends BaseTemplateEngine { * read-protected */ protected function initXmlTemplateEngine ($typePrefix, $xmlTemplateType) { + // Set XML template type and prefix + $this->xmlTemplateType = $xmlTemplateType; + $this->typePrefix = $typePrefix; + // Get template instance $applicationInstance = Registry::getRegistry()->getInstance('app'); @@ -122,7 +126,10 @@ class BaseXmlTemplateEngine extends BaseTemplateEngine { $this->setCodeTemplateExtension($this->getConfigInstance()->getConfigEntry($typePrefix . '_message_template_extension')); // Absolute output path for compiled templates - $this->setCompileOutputPath($this->getConfigInstance()->getConfigEntry('base_path') . $this->getConfigInstance()->getConfigEntry('compile_output_path')); + $this->setCompileOutputPath(sprintf('%s%s', + $templateBasePath, + $this->getConfigInstance()->getConfigEntry('compile_output_path') + )); // Init a variable stacker $stackInstance = ObjectFactory::createObjectByConfiguredName($typePrefix . '_' . $xmlTemplateType . '_stacker_class'); @@ -136,10 +143,6 @@ class BaseXmlTemplateEngine extends BaseTemplateEngine { // Set it $this->setStackInstance($stackInstance); - // Set XML template type and prefix - $this->xmlTemplateType = $xmlTemplateType; - $this->typePrefix = $typePrefix; - // Set it in main nodes array_push($this->mainNodes, str_replace('_', '-', $xmlTemplateType)); } diff --git a/core b/core index 3e5fae60e..7c1f6da0b 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 3e5fae60e3629d3b12cef0bb786f1db7994044ab +Subproject commit 7c1f6da0bb508c369410ff7fed93395bd9a9e65a diff --git a/index.php b/index.php index f0f02f6df..61d534732 100644 --- a/index.php +++ b/index.php @@ -6,6 +6,7 @@ namespace CoreFramework\EntryPoint; use CoreFramework\Bootstrap\FrameworkBootstrap; use CoreFramework\Configuration\FrameworkConfiguration; use CoreFramework\Factory\ObjectFactory; +use CoreFramework\Filesystem\FileNotFoundException; use CoreFramework\Helper\Application\ApplicationHelper; use CoreFramework\Localization\LanguageSystem; use CoreFramework\Loader\ClassLoader; -- 2.39.5