Get Set Bake / Cake1.2 Console in Win Environment
The first thing to do in most of the cake project is designing and creating the database and the next obvious step is usually Baking. Cake1.2 has a console script that handles the Baking stuff very smartly. You will find the console script cake.bat in CAKE_ROOT_DIRECTORY\cake\console\ directory.
If your PHP_ROOT_DIRECTORY is already added to your system path then you can run the script from the command prompt without any problem. Go to CAKE_ROOT_DIRECTORY\cake\console directory from command prompt and start baking your cake by entering the magic command ‘cake bake’.
If the ‘cake bake’ command throws an error message like this -
“‘php’ is not recognized as an internal or external command, operable program or batch file“, – it means the PHP_ROOT_DIRECTORY is not added to your system path. In that case, you have to add the PHP_ROOT_DIRECTORY to your system path first. Go to CAKE_ROOT_DIRECTORY\cake\console directory from the command prompt. If your PHP_ROOT_DIRECTORY is C:\php then enter the following command to set up the path,
set path=C:\php (notice, there is no space before and after the ‘=’),
Now the ‘cake bake’ command should work fine.
If you did not configure the database settings in CAKE_ROOT\app\config\database.php yet then you will see something like the following after running the console script,
Welcome to CakePHP v1.2.0.5427alpha Console
---------------------------------------------------------------
App : app
Path: C:\www_root\one_point_two\app
---------------------------------------------------------------
Your database configuration was not found. Take a moment to create one.
Database Configuration:
Driver: (mysql/mysqli/mssql/sqlite/postgres/odbc/oracle/db2)
[mysql] >
The script will exit when the database configuration is done. Now it should again be executed to continue the baking process. Enter cake bake command again and you will be prompted with something like the following..
Welcome to CakePHP v1.2.0.5427alpha Console
---------------------------------------------------------------
App : app
Path: C:\www_root\one_point_two\app
---------------------------------------------------------------
Interactive Bake Shell
---------------------------------------------------------------
[M]odel
[V]iew
[C]ontroller
[Q]uit
What would you like to Bake? (M/V/C/Q)
Follow the recipe, add ingredients, mix them as you want and after some few seconds you will get your first hot cake right out of the oven.
2 Comments
Jump to comment form | comments rss [?] | trackback uri [?]