0

I got started with my new CakePHP 3.3.9 project today. As usual I wanted to create a few scaffold using cake bake command. As I already had a CakePHP 2.5.5 setup in my machine. I still needed it and its cake bake commands to run to create any thing while working on the cakephp 2.x project. So is there a way I could use both cake bake consoles for CakePHP 2.x and 3.x respectively, at the same time?

Just had a look at possible duplicate. But in my case, I have paths set and I want to use cake bake globally. From anywhere. There might be situations when someone might want to use a cake bake scrip globally. I have a multi-site setup built in CakePHP and in it I create multi-sites based on one core "Cake" Library.

Arvind K.
  • 1,184
  • 2
  • 13
  • 27
  • 1
    Yes, read the manual. http://book.cakephp.org/3.0/en/console-and-shells.html Call the executable of each project, don't use it global. – floriank Dec 07 '16 at 09:07
  • Possible duplicate of [Bash error: cake command not found](http://stackoverflow.com/questions/37249639/bash-error-cake-command-not-found) – AD7six Dec 07 '16 at 16:12

1 Answers1

0

I found my answer anyway.

You can still use both globally just by renaming shell script file to a different name. For example I renamed my cake and cake.bat to cake2 and cake2.bat respectively and it worked just fine, by calling like this:

cake2 bake.

Also posted here http://www.devarticles.in/cakephp/using-cakephp-bake-console-cakephp-2-x-3-x/.

Arvind K.
  • 1,184
  • 2
  • 13
  • 27