Hi all!
I've started on an endeavor of learning and extending Zend_Tool but ran into
some problems I can't seem to solve.
The main problem I'm having is loading custom providers. More specifically,
loading providers that reside in the 'application' folder.
To clarify, loading 'My_Custom_Provider' from
'library/My/Custom/Provider.php' works fine.
But my providers-to-be also need to utilize some of the application
resources from the main application.
This makes them (to some extend) application-aware. Therefore, the 'library'
folders doesn't seem like a good place to put them.
Preferably, I'd like something along the lines of:
'application/tools/SomeProvider.php' > 'App_Tool_SomeProvider'
But both the BasicLoader and the IncludePathLoader just use PEAR-style
naming mapped to filesystem path relative to 1 or more include_path(s).
I couldn't figure out an easy way alter this and/or hook in another loading
mechanism. (e.g. Zend_Loader_Autoloader_Resource).
So what I'm ultimately trying is:
/application
/tools
/HelloProvider.php
/bin
/zf.bat
/zf.sh
/zf.php
> zf say hello
Does anyone know how to achieve this?
Has anyone done this before?
Are there any best practices regarding the subject?
Is it even a good idea to begin with?
Questions, questions..
I hope someone can shine a light on this!
On a side note. I figured that if I need application resources in some of
the providers, a good way to do so would be to
set an instance of Zend_Application in the registry somewhere during setup
of the console client. That way I can easily access them from within a
provider.
Does that sound like a good idea?
All the help is appreciated!
Regards,
Rocco