Example #1
0
 /**
  * __construct() - Instance constructor, needed to get iterators, etc
  *
  * @param  string $namespace
  * @return void
  */
 public function __construct()
 {
     if (!self::$_session instanceof Session\Container) {
         self::$_session = new Session\Container($this->getName());
         foreach (self::$_session as $namespace => $messages) {
             self::$_messages[$namespace] = $messages;
             unset(self::$_session->{$namespace});
         }
     }
 }
Example #2
0
 /**
  * __construct() - Instance constructor, needed to get iterators, etc
  *
  * @param  string $namespace
  * @return void
  */
 public function __construct()
 {
     if (!self::$_session instanceof Session\Container) {
         self::$_session = new Session\Container($this->getName());
         // Should not modify the iterator while iterating; aggregate
         // namespaces so they may be deleted after retrieving messages.
         $namespaces = array();
         foreach (self::$_session as $namespace => $messages) {
             self::$_messages[$namespace] = $messages;
             $namespaces[] = $namespace;
         }
         foreach ($namespaces as $namespace) {
             unset(self::$_session->{$namespace});
         }
     }
 }