From: Chuck Hagenbuch Date: Mon, 8 Jun 2009 14:48:35 +0000 (-0400) Subject: add Horde_Support_Stack X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=80ddb0a4a936611c84eaf657d36e893ced5d6dd7;p=horde.git add Horde_Support_Stack --- diff --git a/framework/Support/lib/Horde/Support/Stack.php b/framework/Support/lib/Horde/Support/Stack.php new file mode 100644 index 000000000..30499f748 --- /dev/null +++ b/framework/Support/lib/Horde/Support/Stack.php @@ -0,0 +1,48 @@ +_a = $stack; + } + + public function push($value) + { + $this->_stack[] = $value; + } + + public function pop() + { + return array_pop($this->_stack); + } + + public function peek($offset = 1) + { + if (isset($this->_stack[count($this->_stack) - $offset])) { + return $this->_stack[count($this->_stack) - $offset]; + } else { + return null; + } + } + +} diff --git a/framework/Support/package.xml b/framework/Support/package.xml index 470adccd3..d88274013 100644 --- a/framework/Support/package.xml +++ b/framework/Support/package.xml @@ -29,6 +29,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> * Initial Horde_Support_Array object * Initial Horde_Support_ConsistentHash object * Initial Horde_Support_Inflector object + * Initial Horde_Support_Stack object * Initial Horde_Support_Stub object * Initial Horde_Support_Timer object * Initial Horde_Support_Uuid object @@ -49,6 +50,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> + @@ -75,6 +77,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> +