Monday, March 25, 2013

Re: Using the latest version of CakePHP console

On Mon, Mar 25, 2013 at 12:56 PM, Daniela Zurita
<danielaazurita@gmail.com> wrote:
> Hi all,
> I'm a newbie to cakephp. I've installed my LAMP server on Ubuntu 12.04.
> Also, created my application in this directory /var/www/myapp. I'm using
> Netbeans IDE 7.3 and cakePHP 2.3.1. This is what i do when attempting to
> bake models, controllers and views, in the terminal window:
>
> 1) go to this directory: /var/www/myApp/lib/Cake

You should be in app, not lib

> 2) grant read/write permission to lib directory
>
> 3) write: Console/cake bake and I get "bash: Console/cake: Permission
> denied"

The cake shell requires execute permissions.

> If i just run the command "cake bake" from /var/www/myApp directory and I
> get
> "Welcome to CakePHP v1.3.7 Console" and I can continue with the baking
> process.

You probably have this older version in your path. In a terminal, run:

echo $PATH

I stopped including cake in my path for just this reason. I have
several sites using different versions and so I want to be sure that
I'm hitting the correct shell. (I often forget to include the
"./Console/" prefix.)

> My questions are:
> 1) is this correct? Models, controllers and views are created within
> "models", "controllers" and "views" folders, under /var/www/myApp directory.
>
> My guess is the code is created under version 1.3, when running the cake
> bake command from my application directory, but i've got installed cakephp
> 2.3

In 2.x the directories should be Controller, Model, and View. You'd
get the lowercase/plural versions because the shell that's executing
is the 1.3.x version.

> 2) how can i bake using CakePHP v2.3 Console?

cd /var/www/myApp/app
./Console/cake

You should then see "Welcome to CakePHP v2.3.1 Console"

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: