From b35a2f9a19e41355f6826d7c9842dce3268c4d84 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 14 May 2014 23:42:53 +0200 Subject: [PATCH] Initialize the file-based stack with initStack() where e.g. the file i/o pointer instance can be set. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../main/decorator/class_BaseDecorator.php | 2 +- .../database/class_DatabaseWrapperFactory.php | 2 +- .../registry/class_SocketRegistryFactory.php | 2 +- .../xml/class_XmlTemplateEngineFactory.php | 2 +- inc/classes/main/file_stack/class_ | 7 ++----- .../main/file_stack/class_BaseFileStack.php | 16 +++++++++++++++- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/inc/classes/main/decorator/class_BaseDecorator.php b/inc/classes/main/decorator/class_BaseDecorator.php index 13304d54..43419592 100644 --- a/inc/classes/main/decorator/class_BaseDecorator.php +++ b/inc/classes/main/decorator/class_BaseDecorator.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Hub Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * diff --git a/inc/classes/main/factories/database/class_DatabaseWrapperFactory.php b/inc/classes/main/factories/database/class_DatabaseWrapperFactory.php index 0c0309b2..f56d9508 100644 --- a/inc/classes/main/factories/database/class_DatabaseWrapperFactory.php +++ b/inc/classes/main/factories/database/class_DatabaseWrapperFactory.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Hub Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * diff --git a/inc/classes/main/factories/registry/class_SocketRegistryFactory.php b/inc/classes/main/factories/registry/class_SocketRegistryFactory.php index 6aaa5a16..34ebbc99 100644 --- a/inc/classes/main/factories/registry/class_SocketRegistryFactory.php +++ b/inc/classes/main/factories/registry/class_SocketRegistryFactory.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Hub Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * diff --git a/inc/classes/main/factories/xml/class_XmlTemplateEngineFactory.php b/inc/classes/main/factories/xml/class_XmlTemplateEngineFactory.php index 38126f9e..8e50d264 100644 --- a/inc/classes/main/factories/xml/class_XmlTemplateEngineFactory.php +++ b/inc/classes/main/factories/xml/class_XmlTemplateEngineFactory.php @@ -6,7 +6,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Hub Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * diff --git a/inc/classes/main/file_stack/class_ b/inc/classes/main/file_stack/class_ index bdec190a..274f923f 100644 --- a/inc/classes/main/file_stack/class_ +++ b/inc/classes/main/file_stack/class_ @@ -42,11 +42,8 @@ class ???FileStack extends BaseFileStack implements Stackable { // Get new instance $stackInstance = new ???FileStack(); - // Get the I/O file pointer instance and handle over file name - $pointerInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_output_class', $fileName); - - // Set instance here in stack - $stackInstance->setPointerInstance($pointerInstance); + // Init this stack + $stackInstance->initStack($fileName); // Return the prepared instance return $stackInstance; diff --git a/inc/classes/main/file_stack/class_BaseFileStack.php b/inc/classes/main/file_stack/class_BaseFileStack.php index 7c4c91e5..724f3c75 100644 --- a/inc/classes/main/file_stack/class_BaseFileStack.php +++ b/inc/classes/main/file_stack/class_BaseFileStack.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2013 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -32,6 +32,20 @@ class BaseFileStack extends BaseFrameworkSystem { // Call parent constructor parent::__construct($className); } + + /** + * Initializes this stack. + * + * @param $fileName File name of this stack + * @return void + */ + protected function initStack ($fileName) { + // Get a file i/o pointer instance + $pointerInstance = ObjectFactory::createObjectByConfiguredName('file_raw_input_output_class' + + // And set it here + $this->setPointerInstance($pointerInstance); + } } // [EOF] -- 2.39.5