3

I'm having some trouble getting the Bake feature of CakePHP 2.0 working.. I think it is down to the way I've got my folder structure set-up, i.e:

file structure

htdocs is the site's root, which contains everything normally found in the 'app' folder. The htdocs/webroot/index.php file has had its CAKE_CORE_INCLUDE_PATH set as the following:

define('CAKE_CORE_INCLUDE_PATH', '..' . DS . '..' . DS . 'cakephp' . DS . 'lib');

I then navigate into the htdocs folder (via putty, it is hosted on a Debian 6 server), and run the following command:

php ../cakephp/lib/Cake/Console/cake.php bake

but based on the fact that the app path listed is "/srv/www/cakeauth.tld.blue/cakephp/app/" rather than what it should be: "/srv/www/cakeauth.tld.blue/htdocs/", means that it doesn't recognise htdocs as an app.

Can anyone help me set this up to run Bake in the correct place? Thank you :)

Daniel Hollands
  • 5,111
  • 3
  • 21
  • 36

3 Answers3

1

After checking the Cookbook, I found that you've got the ability to pass an -app parameter when calling bake, which represents the path to the app...

So in my instance, I would run:

php ../cakephp/lib/Cake/Console/cake.php bake -app /srv/www/cakeauth.tld.local/htdocs/
Daniel Hollands
  • 5,111
  • 3
  • 21
  • 36
0

example ( 4 win ):

env vars

D:\wamp\bin\php\php5.3.8\;D:\wamp\bin\php\includes\framework_cakephp\Cake\Console;

php.ini

include_path = ".;D:\wamp\bin\php\includes;D:\wamp\bin\php\includes\framework_cakephp;"

cmd:

cake bake
type path to app ( d:\wamp\www\my_app )
d:
cd wamp\www\my_app\Console
cake bake

cetver
  • 7,930
  • 5
  • 31
  • 50
0

You need to change the APP_DIR constant as well, to 'htdocs'.

It should also be defined in webroot's index.php

Ivo
  • 5,332
  • 2
  • 15
  • 18
  • APP_DIR is already set to that dynamically, i.e.: `define('APP_DIR', basename(dirname(dirname(__FILE__))));` – Daniel Hollands Jan 23 '12 at 15:17
  • I'm pretty sure setting it to the hard path would let it recognise it, as well as using an absolute path for `CAKE_CORE_INCLUDE_PATH` instead of relative (as it directs you to in the file) would allow it to recongise the proper app normally. `These defines should only be edited if you have cake installed in a directory layout other than the way it is distributed.` – Ivo Jan 24 '12 at 15:39