Issues

ZF-7200: implement __get for Zend_Application_Bootstrap_BootstrapAbstract

Description

Zend_Application_Bootstrap_BootstrapAbstract should make use of __get magic to proxy to getResource().

This would allow codes like (exemple) :


class MyPlugin_FrontController extends Zend_Application_Resource_Frontcontroller
{
    public function init()
    {
        $acl = $this->getBootstrap()->acl;
        // ... ...
    }
}

Comments

Feel free to add this in trunk -- you already have commit access. The idea makes sense.

I'd also encourage adding __isset support that proxies to hasResource().

Ok thats mine, as soon as I have a minute to write the improvement ;-) I auto assign it.

Wait, what would be the advantage?

Dolf -- the advantage would primarily be that access to the various resources would be simpler; there would be no reason to call "getResource()" or "hasResource()" -- just use simply isset() and property retrieval. The bootstrap doesn't have any public properties currently anyways.

Yeah, that's it. __magic methods are very nice as they usually make an API look simpler and "user-friendly"er.

I just wanted Zend review to know if nothing was planned in using more __magic methods in the future in that class. Apparently not, so I'll patch that. I can see no use case about __set() so I wont write one.

Added to classes in SVN at r16555