OK with me. Only point is we need to ensure we don't get strange result with call to get($foo) when $foo is not defined or defined to some strange value. But actually if you give me get/set I can tolerate getInstance too. :)

I'm not in favor of this; aliases that offer no difference in
functionality or usability are not consistent with the goal of
protecting users from excessive choices.

But now that we think of the get() method as static-only, as Stas points
out there is no need to call it on an object, then get() with no
arguments is actually equivalent to getInstance().  The getInstance()
method doesn't need to be public at all.

So the usage to get the default static registry is:
  $r = Zend_Registry::get();

These three are equivalent:
  Zend_Registry::get('foo')
  $r->offsetGet('foo');
  $r['foo'];

These three are equivalent:
  Zend_Registry::set('foo', 'bar')
  $r->offsetSet('foo', 'bar)
  $r['foo'] = 'bar';

The old Zend::initRegistry('classname') method is a bit more clearly
named:
  Zend_Registry::setClassName('classname')

This is needed only by people who want to use a subclass as the static
registry instance.

--
Stanislav Malyshev, Zend Products Engineer
[EMAIL PROTECTED]  http://www.zend.com/

Reply via email to