popNamed() does also now return the current stacker's value.
[core.git] / inc / classes / main / stacker / class_BaseStacker.php
index 3a8bcc028fa659817c4ea8760367bc202f908d35..1bfd88063616920d943e4430c44d2c9798af975e 100644 (file)
@@ -48,12 +48,13 @@ class BaseStacker extends BaseFrameworkSystem {
         * Initializes given stacker
         *
         * @param       $stackerName    Name of the stack
+        * @param       $forceReInit    Force re-initialization
         * @return      void
         * @throws      AlreadyInitializedStackerException      If the stack is already initialized
         */
-       protected final function initStacker ($stackerName) {
+       public final function initStacker ($stackerName, $forceReInit = false) {
                // Is the stack already initialized?
-               if ($this->isStackInitialized($stackerName)) {
+               if (($forceReInit === false) && ($this->isStackInitialized($stackerName))) {
                        // Then throw the exception
                        throw new AlreadyInitializedStackerException(array($this, $stackerName), self::EXCEPTION_STACKER_ALREADY_INITIALIZED);
                } // END - if
@@ -114,7 +115,7 @@ class BaseStacker extends BaseFrameworkSystem {
                        throw new NoStackerException(array($this, $stackerName), self::EXCEPTION_NO_STACKER_FOUND);
                } // END - if
 
-               // So, is the stack full?
+               // So, is the stack empty?
                $isFull = (($this->getStackCount($stackerName)) == 0);
 
                // Return result
@@ -128,7 +129,7 @@ class BaseStacker extends BaseFrameworkSystem {
         * @return      $count                  Size of stack (array count)
         * @throws      NoStackerException      If given stack is missing
         */
-       protected final function getStackCount ($stackerName) {
+       public final function getStackCount ($stackerName) {
                // Is the stack not yet initialized?
                if (!$this->isStackInitialized($stackerName)) {
                        // Throw an exception