]> git.mxchange.org Git - core.git/commitdiff
Stacker classes/interface/exceptions (FiFoStacker is not completed, will follow soon...
authorRoland Häder <roland@mxchange.org>
Mon, 7 Dec 2009 21:37:13 +0000 (21:37 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 7 Dec 2009 21:37:13 +0000 (21:37 +0000)
62 files changed:
.gitattributes
inc/classes/exceptions/stacker/.htaccess [new file with mode: 0644]
inc/classes/exceptions/stacker/class_AlreadyInitializedStackerException.php [new file with mode: 0644]
inc/classes/exceptions/stacker/class_EmptyStackerException.php [new file with mode: 0644]
inc/classes/exceptions/stacker/class_FullStackerException.php [new file with mode: 0644]
inc/classes/exceptions/stacker/class_NoStackerException.php [new file with mode: 0644]
inc/classes/interfaces/actions/class_PerformableAction.php
inc/classes/interfaces/actions/commands/class_Commandable.php
inc/classes/interfaces/auth/class_Authorizeable.php
inc/classes/interfaces/captcha/class_SolveableCaptcha.php
inc/classes/interfaces/class_
inc/classes/interfaces/class_FrameworkInterface.php
inc/classes/interfaces/controller/class_Controller.php
inc/classes/interfaces/criteria/class_Criteria.php
inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php
inc/classes/interfaces/criteria/extended/class_LocalUpdateCriteria.php
inc/classes/interfaces/database/class_Updateable.php
inc/classes/interfaces/database/wrapper/class_BookablePointsWrapper.php
inc/classes/interfaces/database/wrapper/class_ManageableAccountWrapper.php
inc/classes/interfaces/debug/class_Debugger.php
inc/classes/interfaces/discovery/class_Discoverable.php
inc/classes/interfaces/filter/class_Filterable.php
inc/classes/interfaces/helper/class_HelpableLogin.php
inc/classes/interfaces/helper/class_HelpableTemplate.php
inc/classes/interfaces/io/class_Streamable.php
inc/classes/interfaces/io/file/class_FileInputStreamer.php
inc/classes/interfaces/io/file/class_FileOutputStreamer.php
inc/classes/interfaces/io/output/class_OutputStreamer.php
inc/classes/interfaces/language/class_ManageableLanguage.php
inc/classes/interfaces/login/class_LoginableUser.php
inc/classes/interfaces/mailer/class_DeliverableMail.php
inc/classes/interfaces/parser/class_Parseable.php
inc/classes/interfaces/points/class_BookablePoints.php
inc/classes/interfaces/reader/class_ReadableNews.php
inc/classes/interfaces/registration/class_UserRegister.php
inc/classes/interfaces/request/class_Requestable.php
inc/classes/interfaces/resolver/actions/class_ActionResolver.php
inc/classes/interfaces/resolver/class_Resolver.php
inc/classes/interfaces/resolver/commands/class_CommandResolver.php
inc/classes/interfaces/resolver/controller/class_ControllerResolver.php
inc/classes/interfaces/resolver/state/class_StateResolver.php
inc/classes/interfaces/response/class_Responseable.php
inc/classes/interfaces/stacker/.htaccess [new file with mode: 0644]
inc/classes/interfaces/stacker/class_Stackable.php [new file with mode: 0644]
inc/classes/interfaces/state/class_Stateable.php
inc/classes/interfaces/streams/class_Streamable.php
inc/classes/interfaces/streams/crypto/class_EncryptableStream.php
inc/classes/interfaces/template/class_CompileableTemplate.php
inc/classes/interfaces/user/class_ManageableAccount.php
inc/classes/interfaces/user/extended/class_ManageableGuest.php
inc/classes/interfaces/user/extended/class_ManageableMember.php
inc/classes/main/class_
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/stacker/.htaccess [new file with mode: 0644]
inc/classes/main/stacker/class_ [new file with mode: 0644]
inc/classes/main/stacker/class_BaseStacker.php [new file with mode: 0644]
inc/classes/main/stacker/fifo/.htaccess [new file with mode: 0644]
inc/classes/main/stacker/fifo/class_FiFoStacker.php [new file with mode: 0644]
inc/classes/main/stacker/filo/.htaccess [new file with mode: 0644]
inc/classes/main/stacker/filo/class_FiLoStacker.php [new file with mode: 0644]
inc/classes/main/template/menu/class_MenuTemplateEngine.php
inc/config.php

index 0185c481464acb134b29f5f881ecba75c0f250f5..1c4f05abb0cf65159f039fe7f12a5affed5e1c2c 100644 (file)
@@ -94,6 +94,11 @@ inc/classes/exceptions/result/class_InvalidDatabaseResultException.php -text
 inc/classes/exceptions/result/class_ResultUpdateException.php -text
 inc/classes/exceptions/socket/.htaccess -text
 inc/classes/exceptions/socket/class_InvalidSocketException.php -text
 inc/classes/exceptions/result/class_ResultUpdateException.php -text
 inc/classes/exceptions/socket/.htaccess -text
 inc/classes/exceptions/socket/class_InvalidSocketException.php -text
+inc/classes/exceptions/stacker/.htaccess -text
+inc/classes/exceptions/stacker/class_AlreadyInitializedStackerException.php -text
+inc/classes/exceptions/stacker/class_EmptyStackerException.php -text
+inc/classes/exceptions/stacker/class_FullStackerException.php -text
+inc/classes/exceptions/stacker/class_NoStackerException.php -text
 inc/classes/exceptions/state/.htaccess -text
 inc/classes/exceptions/state/class_InvalidStateException.php -text
 inc/classes/exceptions/state/class_InvalidStateInstanceException.php -text
 inc/classes/exceptions/state/.htaccess -text
 inc/classes/exceptions/state/class_InvalidStateException.php -text
 inc/classes/exceptions/state/class_InvalidStateInstanceException.php -text
@@ -202,6 +207,8 @@ inc/classes/interfaces/response/class_Responseable.php -text
 inc/classes/interfaces/result/.htaccess -text
 inc/classes/interfaces/result/class_SearchableResult.php -text
 inc/classes/interfaces/result/class_UpdateableResult.php -text
 inc/classes/interfaces/result/.htaccess -text
 inc/classes/interfaces/result/class_SearchableResult.php -text
 inc/classes/interfaces/result/class_UpdateableResult.php -text
+inc/classes/interfaces/stacker/.htaccess -text
+inc/classes/interfaces/stacker/class_Stackable.php -text
 inc/classes/interfaces/state/.htaccess -text
 inc/classes/interfaces/state/class_Stateable.php -text
 inc/classes/interfaces/streams/.htaccess -text
 inc/classes/interfaces/state/.htaccess -text
 inc/classes/interfaces/state/class_Stateable.php -text
 inc/classes/interfaces/streams/.htaccess -text
@@ -463,6 +470,13 @@ inc/classes/main/result/.htaccess -text
 inc/classes/main/result/class_DatabaseResult.php -text
 inc/classes/main/rng/.htaccess -text
 inc/classes/main/rng/class_RandomNumberGenerator.php -text
 inc/classes/main/result/class_DatabaseResult.php -text
 inc/classes/main/rng/.htaccess -text
 inc/classes/main/rng/class_RandomNumberGenerator.php -text
+inc/classes/main/stacker/.htaccess -text
+inc/classes/main/stacker/class_ -text
+inc/classes/main/stacker/class_BaseStacker.php -text
+inc/classes/main/stacker/fifo/.htaccess -text
+inc/classes/main/stacker/fifo/class_FiFoStacker.php -text
+inc/classes/main/stacker/filo/.htaccess -text
+inc/classes/main/stacker/filo/class_FiLoStacker.php -text
 inc/classes/main/streams/.htaccess -text
 inc/classes/main/streams/class_ -text
 inc/classes/main/streams/class_BaseStream.php -text
 inc/classes/main/streams/.htaccess -text
 inc/classes/main/streams/class_ -text
 inc/classes/main/streams/class_BaseStream.php -text
diff --git a/inc/classes/exceptions/stacker/.htaccess b/inc/classes/exceptions/stacker/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/exceptions/stacker/class_AlreadyInitializedStackerException.php b/inc/classes/exceptions/stacker/class_AlreadyInitializedStackerException.php
new file mode 100644 (file)
index 0000000..2b0cd79
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Thrown if a stacker is already initialized
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class AlreadyInitializedStackerException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param               $messageArray   Error message array
+        * @param               $code                   Error code
+        * @return      void
+        */
+       public function __construct(array $messageArray, $code) {
+               // Construct message
+               $message = sprintf("[%s:%d] Stacker %s already initialized.",
+                       $messageArray[0]->__toString(),
+                       $this->getLine(0),
+                       $messageArray[1]
+               );
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/stacker/class_EmptyStackerException.php b/inc/classes/exceptions/stacker/class_EmptyStackerException.php
new file mode 100644 (file)
index 0000000..429025b
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Thrown if a stacker is empty
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class EmptyStackerException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param               $messageArray   Error message array
+        * @param               $code                   Error code
+        * @return      void
+        */
+       public function __construct(array $messageArray, $code) {
+               // Construct message
+               $message = sprintf("[%s:%d] Stacker %s is empty.",
+                       $messageArray[0]->__toString(),
+                       $this->getLine(0),
+                       $messageArray[1]
+               );
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/stacker/class_FullStackerException.php b/inc/classes/exceptions/stacker/class_FullStackerException.php
new file mode 100644 (file)
index 0000000..dbb23e8
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Thrown if a stacker is full
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FullStackerException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param               $messageArray   Error message array
+        * @param               $code                   Error code
+        * @return      void
+        */
+       public function __construct(array $messageArray, $code) {
+               // Construct message
+               $message = sprintf("[%s:%d] Stacker %s is full.",
+                       $messageArray[0]->__toString(),
+                       $this->getLine(0),
+                       $messageArray[1]
+               );
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/exceptions/stacker/class_NoStackerException.php b/inc/classes/exceptions/stacker/class_NoStackerException.php
new file mode 100644 (file)
index 0000000..108c4fe
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Thrown if a stacker is empty
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class NoStackerException extends FrameworkException {
+       /**
+        * The super constructor for all exceptions
+        *
+        * @param               $messageArray   Error message array
+        * @param               $code                   Error code
+        * @return      void
+        */
+       public function __construct(array $messageArray, $code) {
+               // Construct message
+               $message = sprintf("[%s:%d] Stacker %s is not intialized.",
+                       $messageArray[0]->__toString(),
+                       $this->getLine(0),
+                       $messageArray[1]
+               );
+
+               // Call parent exception constructor
+               parent::__construct($message, $code);
+       }
+}
+
+// [EOF]
+?>
index d16554f4c556265bab00357d9692d0f8b9732bd2..21c292874dbc1311e115c4f65fc6884c8501a7bb 100644 (file)
@@ -32,5 +32,5 @@ interface PerformableAction extends FrameworkInterface {
        function execute (Requestable $requestInstance, Responseable $responseInstance);
 }
 
        function execute (Requestable $requestInstance, Responseable $responseInstance);
 }
 
-//
+// [EOF]
 ?>
 ?>
index a1aa3ffc98f03660c305db51f3cd45429747e537..c4255ac59466152787e7ce3ae4b962540f9e1def 100644 (file)
@@ -32,5 +32,5 @@ interface Commandable extends PerformableAction {
        function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance);
 }
 
        function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 3472e9e0b16ed495908108c64805d19cf15dad9c..f23691a2675d01cac73331464bd48d9ee0737eca 100644 (file)
@@ -37,5 +37,5 @@ interface Authorizeable extends FrameworkInterface {
        function updateAuthData ();
 }
 
        function updateAuthData ();
 }
 
-//
+// [EOF]
 ?>
 ?>
index d47f6dd798eb8b7f607a3a08260099fb58f8c173..c9393e863593a95318b1ee9624f2a2b8526848cc 100644 (file)
@@ -37,5 +37,5 @@ interface SolveableCaptcha extends FrameworkInterface {
        function renderCode ();
 }
 
        function renderCode ();
 }
 
-//
+// [EOF]
 ?>
 ?>
index 5b04acb6a73c1a84bf5b7b2ea58d9836d202a407..0736f56d348ec09c3f5cde9a096d7e4243158c57 100644 (file)
@@ -24,5 +24,5 @@
 interface ??? extends FrameworkInterface {
 }
 
 interface ??? extends FrameworkInterface {
 }
 
-//
+// [EOF]
 ?>
 ?>
index ea2df039f83770441b7565385054b03f504d7cfb..61d098243a5a4c5b9d7d78ad61051e35ae9e1236 100644 (file)
@@ -41,5 +41,5 @@ interface FrameworkInterface {
        function hashCode ();
 }
 
        function hashCode ();
 }
 
-//
+// [EOF]
 ?>
 ?>
index 765a4dbd34f677da0e1147370d91a7868799ced0..fc48100dcd1dad6becc5d4cc2f05d4a599408123 100644 (file)
@@ -32,5 +32,5 @@ interface Controller extends FrameworkInterface {
        function handleRequest (Requestable $requestInstance, Responseable $responseInstance);
 }
 
        function handleRequest (Requestable $requestInstance, Responseable $responseInstance);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 9cda4c4d99e6e63a5969efefe64db23f4c92f960..2ba12f0e094fbe5abf366019bbab3ccc5fc169cd 100644 (file)
@@ -41,5 +41,5 @@ interface Criteria extends FrameworkInterface {
        function addConfiguredCriteria ($criteriaKey, $configEntry);
 }
 
        function addConfiguredCriteria ($criteriaKey, $configEntry);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 051392acef9c16c0aed2d148701ff446f0420a9b..a4a81916723b4a1bb9a57dd9ed52407924d8b174 100644 (file)
@@ -24,5 +24,5 @@
 interface LocalSearchCriteria extends Criteria {
 }
 
 interface LocalSearchCriteria extends Criteria {
 }
 
-//
+// [EOF]
 ?>
 ?>
index f01e0836fc9c3c25232b26a1077c41f2b5dfd311..3ab61199a7cd1c8adec81c062cd54412c22e5828 100644 (file)
@@ -24,5 +24,5 @@
 interface LocalUpdateCriteria extends Criteria {
 }
 
 interface LocalUpdateCriteria extends Criteria {
 }
 
-//
+// [EOF]
 ?>
 ?>
index 57e34f2dc2a5ddcb71fdc3f7c7679383f8b931ea..dd50e9aaf2262aa377f4e0b14b39d7d7db3f8e3b 100644 (file)
@@ -32,5 +32,5 @@ interface Updateable extends FrameworkInterface {
        function updateDatabaseField ($fieldName, $fieldValue);
 }
 
        function updateDatabaseField ($fieldName, $fieldValue);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 2d609eba540893826fb6313f53cb134d8d78551d..2d38466073e9a4d474fa5f53f58cd353f138c068 100644 (file)
@@ -39,5 +39,5 @@ interface BookablePointsWrapper extends FrameworkInterface {
        function doUpdateByResult (UpdateableResult $resultInstance);
 }
 
        function doUpdateByResult (UpdateableResult $resultInstance);
 }
 
-//
+// [EOF]
 ?>
 ?>
index d55ca0decd56c3c2994e28d72015d15ba945aef2..7f443ba98c69b9e561feba59d20868d395d35c97 100644 (file)
@@ -39,5 +39,5 @@ interface ManageableAccountWrapper extends FrameworkInterface {
        function doUpdateByResult (UpdateableResult $resultInstance);
 }
 
        function doUpdateByResult (UpdateableResult $resultInstance);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 2cb5f5626a3c8d95f012740b8c124b5fba7bae5e..7275a568f3c92f170b87b9f6a6817cd926c92e45 100644 (file)
@@ -31,5 +31,5 @@ interface Debugger extends FrameworkInterface {
        function outputStream ($output);
 }
 
        function outputStream ($output);
 }
 
-//
+// [EOF]
 ?>
 ?>
index c886d5f6e804e0e576be985d0e8e1055af84b0fb..d7cde847d827a6043d882f1572672530eb501fe0 100644 (file)
@@ -39,5 +39,5 @@ interface Discoverable extends FrameworkInterface {
        function addResultsToHelper (HelpableTemplate $helperInstance);
 }
 
        function addResultsToHelper (HelpableTemplate $helperInstance);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 99019a26a814b4becedff939891645469868c54d..0825c4541549f2c1bf92ea741d2168b22a1071ac 100644 (file)
@@ -32,5 +32,5 @@ interface Filterable extends FrameworkInterface {
        function execute (Requestable $requestInstance, Responseable $responseInstance);
 }
 
        function execute (Requestable $requestInstance, Responseable $responseInstance);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 09c83c031d674c62ef439c4e0b19fe23f69a4e18..8a8b7a07dd7bbe339b187ead7dec042c62374549 100644 (file)
@@ -32,5 +32,5 @@ interface HelpableLogin extends FrameworkInterface {
        function executeLogin (Responseable $responseInstance);
 }
 
        function executeLogin (Responseable $responseInstance);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 57558d9ea92b203054f21faaffbae9c1f0fd66d5..10a6ba3b84542ec348d61ad6d1fad577eb4d0e09 100644 (file)
@@ -30,5 +30,5 @@ interface HelpableTemplate extends FrameworkInterface {
        function flushContent ();
 }
 
        function flushContent ();
 }
 
-//
+// [EOF]
 ?>
 ?>
index 9f76f716a961b4d1b3653acbdaf48e59419ee52b..71ee8eb88dd9e236c9a92d7b6f7b0376002474f8 100644 (file)
@@ -24,5 +24,5 @@
 interface Streamable extends FrameworkInterface {
 }
 
 interface Streamable extends FrameworkInterface {
 }
 
-//
+// [EOF]
 ?>
 ?>
index fa7591618007fe1a8719900ef4317bc5ca238b0f..2878d72e37c695cc7c4624a6da6d926f12782c6d 100644 (file)
@@ -27,12 +27,11 @@ interface FileInputStreamer extends Streamable {
         *
         * @param       $fqfn   The file's FQFN we shall load
         * @return      $array  An array containing all read lines
         *
         * @param       $fqfn   The file's FQFN we shall load
         * @return      $array  An array containing all read lines
-        * @throws      InvalidArrayCountException      If an array has not the
-        *                                                                      expected size
+        * @throws      InvalidArrayCountException      If an array has not the expected size
         * @throws      InvalidMD5ChecksumException     If two MD5 hashes did not match
         */
        function loadFileContents ($fqfn);
 }
 
         * @throws      InvalidMD5ChecksumException     If two MD5 hashes did not match
         */
        function loadFileContents ($fqfn);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 161decfaef59d820091f14b6761677e796e27207..21f7010c4b95e288e3ca0f23a1f0d67444a42d10 100644 (file)
@@ -27,12 +27,11 @@ interface FileOutputStreamer extends Streamable {
         * external servers.
         *
         * @param       $fileName       The local file's name including full path
         * external servers.
         *
         * @param       $fileName       The local file's name including full path
-        * @param       $dataArray      Array containing the compressor's extension
-        *                                              and streamed data
+        * @param       $dataArray      Array containing the compressor's extension and streamed data
         * @return      void
         */
        function saveFile ($fileName, $dataArray);
 }
 
         * @return      void
         */
        function saveFile ($fileName, $dataArray);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 7fd9c0eb1f9b2e512382640a1616820f84fc3eae..029bb3abe64699b8c268601da1d195648526b6bb 100644 (file)
@@ -30,5 +30,5 @@ interface OutputStreamer extends Streamable {
        function output ($outStream = false);
 }
 
        function output ($outStream = false);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 950ca0a989db8b247be29be4a15c5bccf718541c..385bf9d883b047409ad67d13cbc460782a4e7fee 100644 (file)
@@ -28,7 +28,7 @@ interface ManageableLanguage extends FrameworkInterface {
         * @return      void
         */
        function initLanguageStrings();
         * @return      void
         */
        function initLanguageStrings();
-} // END - class
+}
 
 // [EOF]
 ?>
 
 // [EOF]
 ?>
index 10acedd473092e7d7db3295100bf4d5cf02a4f6d..6f6bac116376fb6e123358750bbc5f91cc6f0791 100644 (file)
@@ -34,5 +34,5 @@ interface LoginableUser extends FrameworkInterface {
        function doLogin (Requestable $requestInstance, Responseable $responseInstance);
 }
 
        function doLogin (Requestable $requestInstance, Responseable $responseInstance);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 814fb64efa43a38e0714a2d54a5105c9a95828bb..b50e77c72ed6702228599721ed083b12d5089496 100644 (file)
@@ -52,5 +52,5 @@ interface DeliverableMail extends FrameworkInterface {
        function sendAdminNotification ();
 }
 
        function sendAdminNotification ();
 }
 
-//
+// [EOF]
 ?>
 ?>
index 61416fffb4ebdbcf1306ee51632ecc601270cfe9..57060e1c5a075f1b4ee72a395a8158e834f22421 100644 (file)
@@ -32,5 +32,5 @@ interface Parseable extends FrameworkInterface {
        function parseXmlContent ($content);
 }
 
        function parseXmlContent ($content);
 }
 
-//
+// [EOF]
 ?>
 ?>
index ee9e114267296246a36f646a18fda12b0aa41b6a..73946e54fa57504a06697613670931b2d573bf76 100644 (file)
@@ -47,5 +47,5 @@ interface BookablePoints extends FrameworkInterface {
        function addElementsToDataSet (StoreableCriteria $criteriaInstance);
 }
 
        function addElementsToDataSet (StoreableCriteria $criteriaInstance);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 2058fbf157d0394c8c153038e29c77becc369efa..4791d8eafdc1e25473b18ba6800ac76ebf77ee27 100644 (file)
@@ -30,5 +30,5 @@ interface ReadableNews extends FrameworkInterface {
        function initializeReader();
 }
 
        function initializeReader();
 }
 
-//
+// [EOF]
 ?>
 ?>
index 33cfc723562cd939ea84435632296327f6b1a11c..3c57c6e29a5fbd559fb1da919f4c39e4ba653c16 100644 (file)
@@ -72,5 +72,5 @@ interface UserRegister extends FrameworkInterface {
        function addElementsToDataSet (StoreableCriteria $criteriaInstance);
 }
 
        function addElementsToDataSet (StoreableCriteria $criteriaInstance);
 }
 
-//
+// [EOF]
 ?>
 ?>
index fef4e3497846a775b5ebdffcbfc50c49624ec706..cda7f3ec1e55386b3b04d5330315a862583c6578 100644 (file)
@@ -78,5 +78,5 @@ interface Requestable extends FrameworkInterface {
        function readCookie ($cookieName);
 }
 
        function readCookie ($cookieName);
 }
 
-//
+// [EOF]
 ?>
 ?>
index bbf58ec3af6923069eba1b89895c6d31cd9d60a6..befb434d9db393f04e620b59ebb3d7cc4e9d2194 100644 (file)
@@ -47,5 +47,5 @@ interface ActionResolver extends Resolver {
        function isActionValid ($actionName);
 }
 
        function isActionValid ($actionName);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 58c13316bfc5496896ae280a300d9ff46a33136c..6d39353f665ce6d77f1ad8076d26306ec3274eeb 100644 (file)
@@ -24,5 +24,5 @@
 interface Resolver extends FrameworkInterface {
 }
 
 interface Resolver extends FrameworkInterface {
 }
 
-//
+// [EOF]
 ?>
 ?>
index e3057e5e5f3b247fa324d66545706fc67ea17f1c..2428bc807f05a7486a6d85806aae642cd5ce09f8 100644 (file)
@@ -40,5 +40,5 @@ interface CommandResolver extends Resolver {
        function isCommandValid ($commandName);
 }
 
        function isCommandValid ($commandName);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 647c5fec91d69ab02e035f588d3b7db2d502deed..06c4592e3b1312668e7e4dd46487a2dd240dd428 100644 (file)
@@ -30,5 +30,5 @@ interface ControllerResolver extends Resolver {
         function resolveController ();
 }
 
         function resolveController ();
 }
 
-//
+// [EOF]
 ?>
 ?>
index cb882c168de3cf3de3678fb3f0b8c3131c94aa0b..c919332e101778d90e0542f0d00935beb44c4555 100644 (file)
@@ -41,5 +41,5 @@ interface StateResolver extends Resolver {
        function isStateValid ($stateName);
 }
 
        function isStateValid ($stateName);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 0a7850c9de5311a55e52b36849f65cd400ed96cd..25f2fc5db71f440a8afc0be57934dbbb3ebe1685 100644 (file)
@@ -110,5 +110,5 @@ interface Responseable extends FrameworkInterface {
        function refreshCookie ($cookieName);
 }
 
        function refreshCookie ($cookieName);
 }
 
-//
+// [EOF]
 ?>
 ?>
diff --git a/inc/classes/interfaces/stacker/.htaccess b/inc/classes/interfaces/stacker/.htaccess
new file mode 100644 (file)
index 0000000..2effffd
--- /dev/null
@@ -0,0 +1,2 @@
+Deny from all
+Deny from all
diff --git a/inc/classes/interfaces/stacker/class_Stackable.php b/inc/classes/interfaces/stacker/class_Stackable.php
new file mode 100644 (file)
index 0000000..22c2ac6
--- /dev/null
@@ -0,0 +1,114 @@
+<?php
+/**
+ * A Stackable interface
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Stackable extends FrameworkInterface {
+       /**
+        * Pushs a value on a named stacker
+        *
+        * @param       $stackerName    Name of the stacker
+        * @param       $value                  Value to push on it
+        * @return      void
+        * @throws      StackerFullException    If the stacker is full
+        */
+       function pushNamed ($stackerName, $value);
+
+       /**
+        * 'Pops' a value from a named stacker
+        *
+        * @param       $stackerName    Name of the stacker
+        * @return      void
+        * @throws      NoStackerException      If the named stacker was not found
+        * @throws      EmptyStackerException   If the named stacker is empty
+        */
+       function popNamed ($stackerName);
+
+       /**
+        * Get value from named stacker
+        *
+        * @param       $stackerName    Name of the stacker
+        * @return      $value                  Value of last added value
+        * @throws      NoStackerException      If the named stacker was not found
+        * @throws      EmptyStackerException   If the named stacker is empty
+        */
+       function getNamed ($stackerName);
+}
+
+// [EOF]
+?>
+<?php
+/**
+ * A Stackable interface
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface Stackable extends FrameworkInterface {
+       /**
+        * Pushs a value on a named stacker
+        *
+        * @param       $stackerName    Name of the stacker
+        * @param       $value                  Value to push on it
+        * @return      void
+        * @throws      StackerFullException    If the stacker is full
+        */
+       function pushNamed ($stackerName, $value);
+
+       /**
+        * 'Pops' a value from a named stacker
+        *
+        * @param       $stackerName    Name of the stacker
+        * @return      void
+        * @throws      NoStackerException      If the named stacker was not found
+        * @throws      EmptyStackerException   If the named stacker is empty
+        */
+       function popNamed ($stackerName);
+
+       /**
+        * Get value from named stacker
+        *
+        * @param       $stackerName    Name of the stacker
+        * @return      $value                  Value of last added value
+        * @throws      NoStackerException      If the named stacker was not found
+        * @throws      EmptyStackerException   If the named stacker is empty
+        */
+       function getNamed ($stackerName);
+}
+
+// [EOF]
+?>
index c6621fdf66c2996f0ce2f4459f5e21b26ad897dc..f19ab1e3c6b998e8f102bf735133176cf75c3003 100644 (file)
@@ -24,5 +24,5 @@
 interface Stateable extends FrameworkInterface {
 }
 
 interface Stateable extends FrameworkInterface {
 }
 
-//
+// [EOF]
 ?>
 ?>
index 9f76f716a961b4d1b3653acbdaf48e59419ee52b..71ee8eb88dd9e236c9a92d7b6f7b0376002474f8 100644 (file)
@@ -24,5 +24,5 @@
 interface Streamable extends FrameworkInterface {
 }
 
 interface Streamable extends FrameworkInterface {
 }
 
-//
+// [EOF]
 ?>
 ?>
index ae4a5e69d08e43dd61417cb688a2ff9fcf583a77..7fcd51244fd419dd55b0dd9fb457c6956c2c4fe1 100644 (file)
@@ -39,5 +39,5 @@ interface EncryptableStream extends Streamable {
        function decryptStream ($encrypted);
 }
 
        function decryptStream ($encrypted);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 6737b56eb3c8af2f9f4c0260c08d73521b111a36..8667cd7bdf086f1d37d1420906967af01ba5e8c3 100644 (file)
@@ -83,7 +83,7 @@ interface CompileableTemplate extends FrameworkInterface {
         * @return      void
         */
        function output ();
         * @return      void
         */
        function output ();
-} // END - class
+}
 
 // [EOF]
 ?>
 
 // [EOF]
 ?>
index 9e775641f46448def52ca1ad99654bbfead9b2b8..ebc32eee5773e61488a548691a52adcd6ab4e30f 100644 (file)
@@ -46,5 +46,5 @@ interface ManageableAccount extends FrameworkInterface {
        function ifPasswordHashMatches (Requestable $requestInstance);
 }
 
        function ifPasswordHashMatches (Requestable $requestInstance);
 }
 
-//
+// [EOF]
 ?>
 ?>
index 044943dcf03e4d73b8a6f12963d229cc00a9d84c..08919fe25983215f0d617057f6820f3432ba96bb 100644 (file)
@@ -24,5 +24,5 @@
 interface ManageableGuest extends ManageableAccount {
 }
 
 interface ManageableGuest extends ManageableAccount {
 }
 
-//
+// [EOF]
 ?>
 ?>
index 32172b0e94a830f72e56559f01a3b4bc7dfd2991..6adabfa1cbca3bfaecc6faf77c3e4e6703ada4f6 100644 (file)
@@ -24,5 +24,5 @@
 interface ManageableMember extends ManageableAccount {
 }
 
 interface ManageableMember extends ManageableAccount {
 }
 
-//
+// [EOF]
 ?>
 ?>
index c5fe84ee8b192b028579a8a9d96a87bca6a7122a..e46dc6a4a388431256150710b68d8c4ab4624548 100644 (file)
@@ -37,6 +37,7 @@ class ???!!! extends Base!!! implements CompileableTemplate {
         *
         * @param       $appInstance    A manageable application
         * @return      $///Instance    An instance of !!!
         *
         * @param       $appInstance    A manageable application
         * @return      $///Instance    An instance of !!!
+        */
        public final static function create???!!! (ManageableApplication $appInstance) {
                // Get a new instance
                $///Instance = new ???!!!();
        public final static function create???!!! (ManageableApplication $appInstance) {
                // Get a new instance
                $///Instance = new ???!!!();
index 0b14dcbb66f1ab787f54b2bc69189a6487c96ec2..10b67239db4697fbe098c0e904462f7f92241f7f 100644 (file)
@@ -98,6 +98,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $imageInstance = null;
 
         */
        private $imageInstance = null;
 
+       /**
+        * Instance of the stacker
+        */
+       private $stackerInstance = null;
+
        /**
         * The real class name
         */
        /**
         * The real class name
         */
@@ -1253,6 +1258,25 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        public final function getImageInstance () {
                return $this->imageInstance;
        }
        public final function getImageInstance () {
                return $this->imageInstance;
        }
+
+       /**
+        * Setter for stacker instanxe
+        *
+        * @param       $stackerInstance        An instance of an stacker
+        * @return      void
+        */
+       public final function setStackerInstance (Stackable $stackerInstance) {
+               $this->stackerInstance = $stackerInstance;
+       }
+
+       /**
+        * Getter for stacker instanxe
+        *
+        * @return      $stackerInstance        An instance of an stacker
+        */
+       public final function getStackerInstance () {
+               return $this->stackerInstance;
+       }
 }
 
 // [EOF]
 }
 
 // [EOF]
diff --git a/inc/classes/main/stacker/.htaccess b/inc/classes/main/stacker/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/stacker/class_ b/inc/classes/main/stacker/class_
new file mode 100644 (file)
index 0000000..1d8d8af
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+/**
+ * A ??? Stacker class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class ???Stacker extends BaseStacker implements Stackable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of the class Stacker and prepares it for usage
+        *
+        * @param       $appInstance    A manageable application
+        * @return      $stackerInstance        An instance of ???Stacker
+        */
+       public final static function create???Stacker (ManageableApplication $appInstance) {
+               // Get a new instance
+               $stackerInstance = new ???Stacker();
+
+               // Init generic stacker
+               $stackerInstance->initStacker('generic');
+
+               // Return the prepared instance
+               return $stackerInstance;
+       }
+
+       /**
+        * Pushs a value on a named stacker
+        *
+        * @param       $stackerName    Name of the stack
+        * @param       $value                  Value to push on it
+        * @return      void
+        * @throws      StackerFullException    If the stack is full
+        */
+       public function pushNamed ($stackerName, $value) {
+               $this->partialStub('stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . $value);
+       }
+
+       /**
+        * 'Pops' a value from a named stacker
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      void
+        * @throws      NoStackerException      If the named stacker was not found
+        * @throws      EmptyStackerException   If the named stacker is empty
+        */
+       public function popNamed ($stackerName) {
+               $this->partialStub('stackerName=' . $stackerName);
+       }
+
+       /**
+        * Get value from named stacker
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      $value                  Value of last added value
+        * @throws      NoStackerException      If the named stacker was not found
+        * @throws      EmptyStackerException   If the named stacker is empty
+        */
+       public function getNamed ($stackerName) {
+               $this->partialStub('stackerName=' . $stackerName);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/stacker/class_BaseStacker.php b/inc/classes/main/stacker/class_BaseStacker.php
new file mode 100644 (file)
index 0000000..31612e1
--- /dev/null
@@ -0,0 +1,216 @@
+<?php
+/**
+ * A general Stacker
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+class BaseStacker extends BaseFrameworkSystem {
+       // Exception codes
+       const EXCEPTION_STACKER_ALREADY_INITIALIZED = 0x050;
+       const EXCEPTION_STACKER_IS_FULL             = 0x051;
+       const EXCEPTION_NO_STACKER_FOUND            = 0x052;
+       const EXCEPTION_STACKER_IS_EMPTY            = 0x053;
+
+       /**
+        * An array holding all stacks
+        */
+       private $stacks = array();
+
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+
+       /**
+        * Initializes given stacker
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      void
+        * @throws      AlreadyInitializedStackerException      If the stack is already initialized
+        */
+       protected final function initStacker ($stackerName) {
+               // Is the stack already initialized?
+               if ($this->isStackInitialized($stackerName)) {
+                       // Then throw the exception
+                       throw new AlreadyInitializedStackerException(array($this, $stackerName), self::EXCEPTION_STACKER_ALREADY_INITIALIZED);
+               } // END - if
+
+               // Initialize the given stack
+               $this->stacks[$stackerName] = array(
+                       'max_size' => $this->getConfigInstance()->getConfigEntry('stacker_' . $stackerName . '_max_size'),
+                       'entries'  => array()
+               );
+       }
+
+       /**
+        * Checks wether the given stack is initialized (set in array $stackers)
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      $isInitialized  Wether the stack is initialized
+        */
+       protected final function isStackInitialized ($stackerName) {
+               // Is is there?
+               $isInitialized = ((isset($this->stacks[$stackerName])) && (is_array($this->stacks[$stackerName])));
+
+               // Return result
+               return $isInitialized;
+       }
+
+       /**
+        * Checks wether the given stack is full
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      $isFull                 Wether the stack is full
+        * @throws      NoStackerException      If given stack is missing
+        */
+       protected final function isStackFull($stackerName) {
+               // Is the stack not yet initialized?
+               if (!$this->isStackInitialized($stackerName)) {
+                       // Throw an exception
+                       throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+               } // END - if
+
+               // So, is the stack full?
+               $isFull = (($this->getStackCount($stackerName)) == $this->getConfigInstance()->getConfigEntry('stacker_' . $stackerName . '_max_size'));
+
+               // Return result
+               return $isFull;
+       }
+
+       /**
+        * Checks wether the given stack is empty
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      $isEmpty                        Wether the stack is empty
+        * @throws      NoStackerException      If given stack is missing
+        */
+       protected final function isStackEmpty($stackerName) {
+               // Is the stack not yet initialized?
+               if (!$this->isStackInitialized($stackerName)) {
+                       // Throw an exception
+                       throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+               } // END - if
+
+               // So, is the stack full?
+               $isFull = (($this->getStackCount($stackerName)) == 0);
+
+               // Return result
+               return $isFull;
+       }
+
+       /**
+        * Getter for size of given stack (array count)
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      $count                  Size of stack (array count)
+        * @throws      NoStackerException      If given stack is missing
+        */
+       protected final function getStackCount ($stackerName) {
+               // Is the stack not yet initialized?
+               if (!$this->isStackInitialized($stackerName)) {
+                       // Throw an exception
+                       throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+               } // END - if
+
+               // Now, count the array of entries
+               $count = count($this->stacks[$stackerName]['entries']);
+
+               // Return result
+               return $count;
+       }
+
+       /**
+        * Adds a value to given stack
+        *
+        * @param       $stackerName    Name of the stack
+        * @param       $value                  Value to add to this stacker
+        * @return      void
+        * @throws      FullStackerException    Thrown if the stack is full
+        */
+       protected final function addValue ($stackerName, $value) {
+               // Is the stack not yet initialized or full?
+               if (!$this->isStackInitialized($stackerName)) {
+                       // Then do it here
+                       $this->initStacker($stackerName);
+               } elseif ($this->isStackFull($stackerName)) {
+                       // Stacker is full
+                       throw new FullStackerException(array($this, $stackerName, $value), self::EXCEPTION_STACKER_IS_FULL);
+               }
+
+               // Now add the value to the stack
+               array_push($this->stacks[$stackerName]['entries'], $value);
+       }
+
+       /**
+        * Get last value from named stacker
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      $value                  Value of last added value
+        * @throws      NoStackerException      If the named stacker was not found
+        * @throws      EmptyStackerException   If the named stacker is empty
+        */
+       protected final function getLastValue ($stackerName) {
+               // Is the stack not yet initialized or full?
+               if (!$this->isStackInitialized($stackerName)) {
+                       // Throw an exception
+                       throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+               } elseif ($this->isStackEmpty($stackerName)) {
+                       //Throw an exception
+                       throw new EmptyStackerException(array($this, $stackerName), self::EXCEPTION_STACKER_IS_EMPTY);
+               }
+
+               // Now get the last value
+               $value = $this->stacks[$stackerName]['entries'][$this->getStackCount($stackerName) - 1];
+
+               // Return it
+               return $value;
+       }
+
+       /**
+        * "Pops" last entry from stack
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      void
+        * @throws      NoStackerException      If the named stacker was not found
+        * @throws      EmptyStackerException   If the named stacker is empty
+        */
+       protected final function popLast ($stackerName) {
+               // Is the stack not yet initialized or full?
+               if (!$this->isStackInitialized($stackerName)) {
+                       // Throw an exception
+                       throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
+               } elseif ($this->isStackEmpty($stackerName)) {
+                       //Throw an exception
+                       throw new EmptyStackerException(array($this, $stackerName), self::EXCEPTION_STACKER_IS_EMPTY);
+               }
+
+               // Now, remove the last entry, we don't care about the return value here, see elseif() block above
+               array_pop($this->stacks[$stackerName]['entries']);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/stacker/fifo/.htaccess b/inc/classes/main/stacker/fifo/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/stacker/fifo/class_FiFoStacker.php b/inc/classes/main/stacker/fifo/class_FiFoStacker.php
new file mode 100644 (file)
index 0000000..fa88aa9
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+/**
+ * A FiFo Stacker class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FiFoStacker extends BaseStacker implements Stackable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of the class Stacker and prepares it for usage
+        *
+        * @return      $stackerInstance        An instance of FiFoStacker
+        */
+       public final static function createFiFoStacker () {
+               // Get a new instance
+               $stackerInstance = new FiFoStacker();
+
+               // Init generic stacker
+               $stackerInstance->initStacker('generic');
+
+               // Return the prepared instance
+               return $stackerInstance;
+       }
+
+       /**
+        * Pushs a value on a named stacker
+        *
+        * @param       $stackerName    Name of the stack
+        * @param       $value                  Value to push on it
+        * @return      void
+        * @throws      StackerFullException    If the stack is full
+        */
+       public function pushNamed ($stackerName, $value) {
+               $this->partialStub('stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . $value);
+       }
+
+       /**
+        * 'Pops' a value from a named stacker
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      void
+        * @throws      NoStackerException      If the named stacker was not found
+        * @throws      EmptyStackerException   If the named stacker is empty
+        */
+       public function popNamed ($stackerName) {
+               $this->partialStub('stackerName=' . $stackerName);
+       }
+
+       /**
+        * Get value from named stacker
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      $value                  Value of last added value
+        * @throws      NoStackerException      If the named stacker was not found
+        * @throws      EmptyStackerException   If the named stacker is empty
+        */
+       public function getNamed ($stackerName) {
+               $this->partialStub('stackerName=' . $stackerName);
+       }
+}
+
+// [EOF]
+?>
diff --git a/inc/classes/main/stacker/filo/.htaccess b/inc/classes/main/stacker/filo/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/inc/classes/main/stacker/filo/class_FiLoStacker.php b/inc/classes/main/stacker/filo/class_FiLoStacker.php
new file mode 100644 (file)
index 0000000..1a80cef
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/**
+ * A FiLo Stacker class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class FiLoStacker extends BaseStacker implements Stackable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of the class Stacker and prepares it for usage
+        *
+        * @return      $stackerInstance        An instance of FiLoStacker
+        */
+       public final static function createFiLoStacker () {
+               // Get a new instance
+               $stackerInstance = new FiLoStacker();
+
+               // Init the generic stacker
+               $stackerInstance->initStacker('generic');
+
+               // Return the prepared instance
+               return $stackerInstance;
+       }
+
+       /**
+        * Pushs a value on a named stacker
+        *
+        * @param       $stackerName    Name of the stack
+        * @param       $value                  Value to push on it
+        * @return      void
+        * @throws      StackerFullException    If the stack is full
+        */
+       public function pushNamed ($stackerName, $value) {
+               // Call the protected method
+               parent::addValue($stackerName, $value);
+       }
+
+       /**
+        * 'Pops' a value from a named stacker
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      void
+        * @throws      NoStackerException      If the named stacker was not found
+        * @throws      EmptyStackerException   If the named stacker is empty
+        */
+       public function popNamed ($stackerName) {
+               // Call the protected method
+               parent::popLast($stackerName);
+       }
+
+       /**
+        * Get value from named stacker
+        *
+        * @param       $stackerName    Name of the stack
+        * @return      $value                  Value of last added value
+        * @throws      NoStackerException      If the named stacker was not found
+        * @throws      EmptyStackerException   If the named stacker is empty
+        */
+       public function getNamed ($stackerName) {
+               // Call the protected method
+               return parent::getLastValue($stackerName);
+       }
+}
+
+// [EOF]
+?>
index 37dfca2c88383705bc79500e1bab95c159dbee4d..597b0149ef0a2b7cadb84ecd140f2690799fcf76 100644 (file)
@@ -141,6 +141,12 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                // Set the menu instance
                $tplInstance->setMenuInstance($menuInstance);
 
                // Set the menu instance
                $tplInstance->setMenuInstance($menuInstance);
 
+               // Init a variable stacker
+               $stackerInstance = ObjectFactory::createObjectByConfiguredName('menu_stacker_class');
+
+               // Set it
+               $tplInstance->setStackerInstance($stackerInstance);
+
                // Return the prepared instance
                return $tplInstance;
        }
                // Return the prepared instance
                return $tplInstance;
        }
@@ -279,8 +285,9 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                        return false;
                } // END - if
 
                        return false;
                } // END - if
 
-               // Unfinished work!
-               $this->partialStub('Handling extra characters is not yet supported! length='.strlen($characters));
+               // Assign the found characters to variable and use the last entry from
+               // stack as the name
+               parent::assignVariable($this->getStackerInstance()->getNamed('current_node'), $characters);
        }
 
        /**
        }
 
        /**
@@ -465,13 +472,164 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
                $this->assignVariable('footer_end', $this->getTemplateInstance()->getRawTemplateData());
        }
 
                $this->assignVariable('footer_end', $this->getTemplateInstance()->getRawTemplateData());
        }
 
+       /**
+        * Starts the menu property 'block-list'
+        *
+        * @return      void
+        */
+       private function startBlockList () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'block-list');
+       }
+
+       /**
+        * Starts the menu property 'block'
+        *
+        * @return      void
+        */
+       private function startBlock () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'block');
+       }
+
        /**
         * Starts the menu property 'title'
         *
         * @return      void
         */
        private function startTitle () {
        /**
         * Starts the menu property 'title'
         *
         * @return      void
         */
        private function startTitle () {
-               $this->partialStub('Cleared due to XML rewrite.');
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'title');
+       }
+
+       /**
+        * Starts the menu property 'title-id'
+        *
+        * @return      void
+        */
+       private function startTitleId () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'title-id');
+       }
+
+       /**
+        * Starts the menu property 'title-class'
+        *
+        * @return      void
+        */
+       private function startTitleClass () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'title-class');
+       }
+
+       /**
+        * Starts the menu property 'title-text'
+        *
+        * @return      void
+        */
+       private function startTitleText () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'title-text');
+       }
+
+       /**
+        * Starts the menu property 'entry'
+        *
+        * @return      void
+        */
+       private function startEntry () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'entry');
+       }
+
+       /**
+        * Starts the menu property 'entry-id'
+        *
+        * @return      void
+        */
+       private function startEntryId () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'entry-id');
+       }
+
+       /**
+        * Starts the menu property 'anchor'
+        *
+        * @return      void
+        */
+       private function startAnchor () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'anchor');
+       }
+
+       /**
+        * Starts the menu property 'anchor-id'
+        *
+        * @return      void
+        */
+       private function startAnchorId () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'anchor-id');
+       }
+
+       /**
+        * Starts the menu property 'anchor-text'
+        *
+        * @return      void
+        */
+       private function startAnchorText () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'anchor-text');
+       }
+
+       /**
+        * Starts the menu property 'anchor-title'
+        *
+        * @return      void
+        */
+       private function startAnchorTitle () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'anchor-title');
+       }
+
+       /**
+        * Starts the menu property 'anchor-href'
+        *
+        * @return      void
+        */
+       private function startAnchorHref () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'anchor-href');
+       }
+
+       /**
+        * Starts the menu property 'footer-id'
+        *
+        * @return      void
+        */
+       private function startFooterId () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'footer-id');
+       }
+
+       /**
+        * Starts the menu property 'footer-class'
+        *
+        * @return      void
+        */
+       private function startFooterClass () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'footer-class');
+       }
+
+       /**
+        * Starts the menu property 'footer-text'
+        *
+        * @return      void
+        */
+       private function startFooterText () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('current_node', 'footer-text');
        }
 
        /**
        }
 
        /**
@@ -480,87 +638,199 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         * @return      void
         */
        private function finishTitle () {
         * @return      void
         */
        private function finishTitle () {
-               $this->partialStub('Cleared due to XML rewrite.');
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
        }
 
        /**
        }
 
        /**
-        * Starts the menu text
+        * Finishes the title-id node by
         *
         * @return      void
         */
         *
         * @return      void
         */
-       private function startText () {
-               // Do we have a template instance?
-               if (is_null($this->getTemplateInstance())) {
-                       // Init template instance for underlaying web templates
-                       $templateInstance = ObjectFactory::createObjectByConfiguredName('web_template_class');
+       private function finishTitleId () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
+       }
 
 
-                       // Set it in this template engine
-                       $this->setTemplateInstance($templateInstance);
-               } // END - if
+       /**
+        * Finishes the title-class node
+        *
+        * @return      void
+        */
+       private function finishTitleClass () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
+       }
 
 
-               // Load the text template for this page
-               $this->getTemplateInstance()->loadCodeTemplate('menu_text_start');
+       /**
+        * Finishes the title-class node
+        *
+        * @return      void
+        */
+       private function finishTitleText () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
+       }
 
 
-               // Set the variable group to page
-               $this->setVariableGroup('menu');
+       /**
+        * Finishes the footer-text node
+        *
+        * @return      void
+        */
+       private function finishFooterText () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
+       }
 
 
-               // Set its content in this template instance
-               $this->assignVariable('text', $this->getTemplateInstance()->getRawTemplateData());
+       /**
+        * Finishes the footer-class node
+        *
+        * @return      void
+        */
+       private function finishFooterClass () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
        }
 
        /**
        }
 
        /**
-        * Finishes the menu text
+        * Finishes the footer-id node
         *
         * @return      void
         */
         *
         * @return      void
         */
-       private function finishText () {
-               // Load the text template for this page
-               $this->getTemplateInstance()->loadCodeTemplate('menu_text_end');
+       private function finishFooterId () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
+       }
 
 
-               // Set the variable group to page
-               $this->setVariableGroup('menu');
+       /**
+        * Finishes the anchor-href node
+        *
+        * @return      void
+        */
+       private function finishAnchorHref () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
+       }
 
 
-               // Set its content in this template instance
-               $this->assignVariable('text_end', $this->getTemplateInstance()->getRawTemplateData());
+       /**
+        * Finishes the anchor-title node
+        *
+        * @return      void
+        */
+       private function finishAnchorTitle () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
        }
 
        /**
        }
 
        /**
-        * Starts the menu property 'entry'
+        * Finishes the anchor-text node
         *
         * @return      void
         */
         *
         * @return      void
         */
-       private function startEntry () {
-               $this->partialStub('Cleared due to XML rewrite.');
+       private function finishAnchorText () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
        }
 
        /**
        }
 
        /**
-        * Finishes the entry node by added another template to the menu
+        * Finishes the anchor-id node
+        *
+        * @return      void
+        */
+       private function finishAnchorId () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
+       }
+
+       /**
+        * Finishes the anchor node
+        *
+        * @return      void
+        */
+       private function finishAnchor () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
+       }
+
+       /**
+        * Finishes the entry-id node
+        *
+        * @return      void
+        */
+       private function finishEntryId () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
+       }
+
+       /**
+        * Finishes the entry node
         *
         * @return      void
         */
        private function finishEntry () {
         *
         * @return      void
         */
        private function finishEntry () {
-               $this->partialStub('Cleared due to XML rewrite.');
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
        }
 
        /**
        }
 
        /**
-        * Starts the menu property 'anchor'
+        * Finishes the block node
         *
         *
-        * @param       $id             Id of the anchor
-        * @param       $link   Link text of the anchor
-        * @param       $title  Link title of the anchor
         * @return      void
         */
         * @return      void
         */
-       private function startAnchor () {
-               $this->partialStub('Please implement this method.');
+       private function finishBlock () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
        }
 
        /**
        }
 
        /**
-        * Finishes the anchor node by added another template to the menu
+        * Finishes the block-list node
         *
         * @return      void
         */
         *
         * @return      void
         */
-       private function finishAnchor () {
-               $this->partialStub('Please implement this method.');
+       private function finishBlockList () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('current_node');
+       }
+
+       /**
+        * Starts the menu text
+        *
+        * @return      void
+        */
+       private function startText () {
+               // Do we have a template instance?
+               if (is_null($this->getTemplateInstance())) {
+                       // Init template instance for underlaying web templates
+                       $templateInstance = ObjectFactory::createObjectByConfiguredName('web_template_class');
+
+                       // Set it in this template engine
+                       $this->setTemplateInstance($templateInstance);
+               } // END - if
+
+               // Load the text template for this page
+               $this->getTemplateInstance()->loadCodeTemplate('menu_text_start');
+
+               // Set the variable group to page
+               $this->setVariableGroup('menu');
+
+               // Set its content in this template instance
+               $this->assignVariable('text', $this->getTemplateInstance()->getRawTemplateData());
+       }
+
+       /**
+        * Finishes the menu text
+        *
+        * @return      void
+        */
+       private function finishText () {
+               // Load the text template for this page
+               $this->getTemplateInstance()->loadCodeTemplate('menu_text_end');
+
+               // Set the variable group to page
+               $this->setVariableGroup('menu');
+
+               // Set its content in this template instance
+               $this->assignVariable('text_end', $this->getTemplateInstance()->getRawTemplateData());
        }
 
        /**
        }
 
        /**
index 9e33cfadecfd6407cf8a5d18e602ff54a978719b..817a337926b5b69325cb0a76d2c0b24d5a4691ae 100644 (file)
@@ -305,5 +305,14 @@ $cfg->setConfigEntry('product_install_mode', 'debug');
 // CFG: DECIMALS
 $cfg->setConfigEntry('decimals', 3);
 
 // CFG: DECIMALS
 $cfg->setConfigEntry('decimals', 3);
 
+// CFG: STACKER-CLASS
+$cfg->setConfigEntry('menu_stacker_class', 'FiLoStacker');
+
+// CFG: STACKER-GENERIC-MAX-SIZE
+$cfg->setConfigEntry('stacker_generic_max_size', 100);
+
+// CFG: STACKER-CURRENT-NODE-MAX-SIZE
+$cfg->setConfigEntry('stacker_current_node_max_size', 20);
+
 // [EOF]
 ?>
 // [EOF]
 ?>