Proposal for a new Cake Bake for 3.0

113 views
Skip to first unread message

shama

unread,
Aug 17, 2012, 4:21:15 PM8/17/12
to cakeph...@googlegroups.com
A proposal for a new Cake Bake for 3.0: https://github.com/shama/cakephp/wiki/Rebaker

I'd love to get feedback on this. I think this would be extremely useful for 3.0. Thanks!

euromark

unread,
Aug 17, 2012, 8:05:55 PM8/17/12
to cakeph...@googlegroups.com
I think you forgot to mention one problem:
- plugin interaction (baking plugin stuff in combination with non-plugin app stuff breaks a lot of things right now)
most of it could probably be covered with yours, as well, i guess

José Lorenzo

unread,
Aug 19, 2012, 3:33:07 AM8/19/12
to cakeph...@googlegroups.com
I really like the idea shama, I'm very interested in seeing how this develops. Could this be the beginning for faking a full admin backend like in django?

shama

unread,
Aug 19, 2012, 2:39:39 PM8/19/12
to cakeph...@googlegroups.com
Indeed. I think using traits as you suggest would be perfect for an admin backend. I think it will be interesting to experiment with an trait that modifies the behavior of a MVC chain. Then being able to bake and continually rebake as the app evolves over time.

Another possibility is integrating the Meta classes as Fixtures. Might make testing app/class conditions very fun.

Thanks euromark! I updated the doc including a plugin baking example.

Juan Basso

unread,
Aug 19, 2012, 3:14:46 PM8/19/12
to cakeph...@googlegroups.com
From my impressions seems more complicated to generate the initial version, but a huge gain in long term.

Juan Basso

Graham Weldon

unread,
Aug 19, 2012, 6:51:45 PM8/19/12
to cakeph...@googlegroups.com
Following on from what Juan has said.. its a big effort. Built correctly, and keeping the initial goals in mind throughout development, this will be a huge benefit to our users.

--
Cheers,
Graham Weldon
http://grahamweldon.com
e. gra...@grahamweldon.com
p. (+61) 0407 017 293

Skype: grahamweldon


Renan Gonçalves

unread,
Aug 19, 2012, 7:14:15 PM8/19/12
to cakeph...@googlegroups.com
I guess you will be able to use bake to generate the initial version. And then modify at will.
--
Renan Gonçalves aka renan.saddam
Software Engineer at TrueServer B.V.
CakePHP Core Developer

W: renangoncalves.com
M: +31 (0)6 4662 1860
L: Amsterdam, The Netherlands

mark_story

unread,
Aug 22, 2012, 3:59:17 PM8/22/12
to cakeph...@googlegroups.com
I like the concept, and the possibility of having a config file for advanced users.

How are you planning on integrating the proposed metaclass features and the existing interactive console features?  While the interactive console can be a bit cumbersome if you know what you want, its great when you don't know what you want, and need a hand to get there.  Since we're talking about re-working bake, a common request in the past was to allow userland code generators/bake tasks to be more easily created.

-Mark

shama

unread,
Aug 22, 2012, 7:12:57 PM8/22/12
to cakeph...@googlegroups.com
Ideally the interactive console would operate the same except for some of these possible benefits:
  • `cake bake all` (among the other tasks) can be ran over and over without overwriting modified code.
     
  • `cake bake app` available:
    • Interactively it could bake different template projects. Such as: Pages (current), Blog, Tutorial, etc.
    • A custom project config file could be used for a custom baked apps. Even multiple configs could be merged. Such as baking a blog app: start with a core config, merge in a plugin that alters the core config and lastly merge the user's own modifications.
       
  • `cake bake watch` to continuously watch a project bake config file then rebake as it's modified.
     
  • A user can customize how it bakes by overriding the Meta classes in their `App/Lib/Meta/` folder. Such as if they want to bake using the PSR-2 style guidelines. A user would extend the MetaClass and add their own PSR2 Trait (that would be built on top of the core CakePHP one, mwuahaha).

  • The core templates can become actual PHP classes rather than the current templates. The classes would be read by MetaClass and then inject data from the interactive console. Or the templates could be constructed from thin air using the MetaClass interface. The user could override these as well by creating their own in `App/Lib/Meta/Template/`.

  • More advanced functionality could be built into the bake templates. For example when baking test cases; we could go further and detect method parameters and the return type if available. Then fill in the test methods with some boilerplate test code.

I imagine this would reduce a great deal of code in `Console/Command/Tasks/` and `Console/Templates/`. Then add, hopefully, considerably less and more easily maintainable code into `Meta/`.

Also we could opt to not ship Cake with an App folder. Then have it built on the fly even without a CLI, it would be possible.

- Kyle
Reply all
Reply to author
Forward
0 new messages