In a CakePHP project I'm working on, I'm trying to move into the Git version control system. The Bravo_Kernel blog has an article explaining how to set the whole thing up, which worked fine here. However, I had problems using "cake schema generate" after the setup.
It seems that the cake shells need to receive a command letting them know that the app itself is not in the default location. That's done with the -app argument (run the cake console with no arguments for syntax). My comment over at Bravo_Kernel explains these details, too:
Extra piece of information for anyone else attempting this. I had a problem running a “cake schema generate” on the console after making this change. It wasn’t using the database connection details in my app/config.
The root problem seems to be that when running the console, you need to specify the application path relative to the non-standard cake core path used above (or use an absolute path, if desired). Get your path info by running the cake console with no arguments. Here’s what I got:
Current Paths:
-app: app
-working: /var/www/cakesites/artemis2_cakephp_1.3.0/cakephp/app
-root: /var/www/cakesites/artemis2_cakephp_1.3.0/cakephp
-core: /var/www/cakesites/artemis2_cakephp_1.3.0/cakephpApparently, the console works relative to the core rather than determining it’s location through the webroot conf line changed above. In my case, I needed to change the command:
cake schema generate
into:
cake -app ../app schema generate
The schema generation worked fine with that change. I suspect, though haven’t tested, that a “cake bake” (as well as the other shells) would also work incorrectly without the added app argument. I’m not sure if one of the other config options in app/webroot/index.php or elsewhere could be changed to make this unnecessary.
Add new comment