2

I'm pretty new to CakePHP and i'm running through both the Cake Book and the Apress Book CakePHP from novice to professional, but i can't seem to understand what's going on on my bake console.

I've got it installed and seems to work fine. But when i type in cake bake it shows me this

Welcome to CakePHP v2.0.0 Console
--------------------------------------------------------------------
App: htdocs
Path: W:\xampp\htdocs\
--------------------------------------------------------------------
What is the path to the project you want to bake?
[W:\xampp\htdocs\myapp] >

instead of what the books say it should be

---------------------------------------------------------------
App : app
Path: /path-to/project/app
---------------------------------------------------------------
Interactive Bake Shell
---------------------------------------------------------------
[D]atabase Configuration
[M]odel
[V]iew
[C]ontroller
[P]roject
[F]ixture
[T]est case
[Q]uit
What would you like to Bake? (D/M/V/C/P/F/T/Q)
>

if i follow the questions on my cake console, it asks me the path to the directory layout i wish to copy, and then seems to override everything i have with that skel one.

on the other hand, if i follow the book's steps and type cake bake view or cake bake model it seems to understand that i'm talking about projects named view and model and tell me there's no database configuration for those projects, etc. So, if i type the project path first, i don't get to choose what to do. But if i leave it out, it has no way of knowing. See where this is going?

I'm using the regular Windows cmd.exe, not cygwin as i've seen some people recommending, and can provide more detail if needed. There's probably an easy solution for this, so I appreciate your help!

tereško
  • 58,060
  • 25
  • 98
  • 150
moraleida
  • 424
  • 6
  • 22

1 Answers1

5

you are in the wrong path. If you want to bake internal stuff (models, controllers, views, ...) etc you need to navigate to the app folder and execute cake there (or define your app path with -app)

details and hot tip for windows: http://www.dereuromark.de/tag/cake-console-windows/

mark
  • 21,691
  • 3
  • 49
  • 71
  • I knew it was simple. I've tried it from many paths, but never from the app folder - this does make sense after you think about it, but i thought it should work from the project root folder. Also, there's no direct mention of this here: http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html – moraleida Oct 31 '11 at 23:48
  • Would you please specify the file path you used to execute `bake` in Cake 2.0? I am unclear on the answer you provided here. Do you execute cake from app/Cake/Console, or do you execute it by running that path in Terminal? – deewilcox Nov 01 '11 at 16:08
  • as @mark taught me above, the correct path to run `cake bake` is w:\xampp\htdocs\project\app - i was running it from w:\xampp\htdocs\project – moraleida Nov 01 '11 at 16:52