11 Dec

Quick Tip: Activate CakePHP console in one go

CakePHP

Let me share a quickie which will save you a few seconds if you’re using CakePHP under Windows environment. To activate CakePHP shell, you must be doing it ugly way which involves copying up full path of ‘app’ directory or cake’s console directory. To overcome this:

  1. Create a new separate directory somewhere on your machine (say 3rdpartytools)
  2. Create a batch file here called cake.bat with following contents:

    @echo off

    ..\cake\console\cake %*

  3. Now, add this directory to your ‘Path’ variable (environment variable) from control panel.
  4. Restart windows and you’re done.

Now to activate CakePHP shell, just open ‘cmd’ from working app directory and type your favorite command like ‘cake schema generate –f’ or anything. What happens behind the scene? Our own cake.bat is called after we issue a command, which then passes execution to console’s cake.bat.

Hope it saves you some time.

Leave A Reply







Hire us

Contact us to get a free quote on your project.