How Zend Registry Works

I am wondering if Zend_Registry uses phpMemory, sessions, or another method.

This question is more interesting.

Zend_Registry::set('test', array());
+3
source share
2 answers

Zend_Registry is a wrapper around a variable that stores an array. static

Transforming a static variable from Wikipedia

In computer programming, a static variable is a variable that has been distributed statically, whose life time extends to the entire program.

Similarly, variables stored inside Zend_Registry apply to the entire program run.

A simple class of my registry

    class My_Registry
    {
    static $storage;

   public static function set($key,$value)
    {
    self::$storage[$key] = $value;
    }


 public static function get($key)
    {
    return self::$storage[$key];
    }
    }
+6
source

Zend_Registry - ( ArrayObject). , .

+1

All Articles