Closed Ocramius closed 11 years ago
The PR looks really good, lots of improvements made in the overall code.
I don't agree with the deprecation of the crawl logic, the functionality is provided by a lot of other Ext.Direct generators and personally i find it really useful to be able to use convention over configuration.
What is your intended use for the docs
folder? I prefer to keep the documentation centralized in the wiki, i shall cleanup the current mess tomorrow so it can be added there.
@Rovak I prefer keeping docs with the repo itself since it forces users to clone it together... I can move it if you prefer so :)
On the crawl logic, the problem is that the only way to operate with (let's say) DB data on invokables are either service initializers (making invokables implement SomethingAwareInterface
, which is kinda crappy) or using static methods, which is a "game over" for me (once you got the static method in, good luck getting it out of there!). You can see some of those patterns applied in the old view helpers, like Zend_View_Helper_Action
, where you just asked for an "action" plugin and the framework did all the inflection/file matching/autoloading things for you.
Direct mapping via services allows instead to avoid that by following the patterns introduced in ZF2.
It is mainly related to educating the end user about good and bad approaches. The technique of crawling directories for invokables is a niche and you meet its limitations too easily :(
For now i prefer to keep things in the Wiki, i may setup a Jenkins job later which syncs the docs
files to the Wiki because i have to agree that cloning the docs together is helpful.
About the crawling, in our internal version we use a AbstractDirectService which is a lightweight AbstractController with a pluginmanager that contains ExtJS specific helpers. I mainly use Direct for really small PHP methods which call service methods, so i may not face the same problems as you are having.
There is a lot of room for improvement and i will create a new PR in which we can discuss further changes in the crawling as soon as this one is merged.
@Rovak fine by me :) I'm not saying "let's remove it". If you know what you are doing, then it's already fine. As said, it's more a matter of educating the end user. Will move on addressing your comments tomorrow, and then adding a new commit to remove any unused files/methods (to be reviewed, since it may be BC on your side)
This PR introduces following new features:
ModuleApi
class, which now is a simple wrapper of available actions (may rename it shortly intoApiContainer
orActionContainer
)KJSencha\Frontend\Bootstrap
in favor of explicit view helpersHope you like it :D