From: Roland Haeder Date: Wed, 14 May 2014 21:42:53 +0000 (+0200) Subject: Initialize the file-based stack with initStack() where e.g. the file i/o X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=b35a2f9a19e41355f6826d7c9842dce3268c4d84 Initialize the file-based stack with initStack() where e.g. the file i/o pointer instance can be set. Signed-off-by: Roland Häder --- 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]