z22
z22

Reputation: 10083

cakephp bake using command line in mac

i have setup the path variable in mac for cakephp to use command line baking. Everything works fine except the model gets created in a default location instead of a specific project which is just created. that is when i write cake bake and select M[model], the model gets created but in default folder i.e.

/Applications/MAMP/htdocs/cakephp/app/Model/

instead of

/Applications/MAMP/htdocs/testApp/Model/

i also tried it by changing the directory path(i.e the basic cd command) where am i getting wrong? How do i solve it?

Upvotes: 0

Views: 2325

Answers (2)

Arnold
Arnold

Reputation: 11

In a unix based environment i prefer using aliases relative to the project root opposed to mapping it to a specific cake lib globally.

Dump this in your respective shell config ".profile/.bashrc/.zshrc"

# Alias functions
alias cake='app/Console/cake'
alias cakelogs='tail -f app/tmp/logs/*'

and while your in you project root

cake {cmd}

should work as expected.

Upvotes: 1

mjspier
mjspier

Reputation: 6536

If you use a different cakephp core for your project you have to set the working app path when you use the cakephp console. This can be done with the -app parameter.

example:

cake -app /Applications/MAMP/htdocs/testApp/app bake

Upvotes: 1

Related Questions