views:

63

answers:

1

Hello all

I am trying to create a controller in cakephp(1.3) using console. I am using windows XP and XAMPP.

My current cake console settings below

C:\xampp\htdocs\cake\apressblog\cake\console>cake

♀ Welcome to CakePHP v1.3.4 Console --------------------------------------------------------------- Current Paths: -app: console -working: C:\xampp\htdocs\cake\apressblog\cake\console -root: C:\xampp\htdocs\cake\apressblog\cake -core: C:\xampp\htdocs\cake\apressblog

Changing Paths: your working path should be the same as your application path to change your path use the '-app' param. Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp

Available Shells: acl [CORE]
i18n [CORE]

api [CORE]
schema [CORE]

bake [CORE]
testsuite [CORE]

console [CORE]

To run a command, type 'cake shell_name [args]' To get help on a specific command, type 'cake shell_name help'

C:\xampp\htdocs\cake\apressblog\cake\console>-app c:\xampp '-app' is not recognized as an internal or external command, operable program or batch file.

C:\xampp\htdocs\cake\apressblog\cake\console>

what are the path settings I need to set for creating a controller from console ? I tried to change the app path but, when I type command cake It goes app directory to console,

Could you please help me to solve this issue

when I try to create a controller I am getting the following error :

C:\xampp\htdocs\cake\apressblog\cake\console>cake bake controller news

♀
Welcome to CakePHP v1.3.4 Console
---------------------------------------------------------------
App : console
Path: C:\xampp\htdocs\cake\apressblog\cake\console
---------------------------------------------------------------

Creating file C:\xampp\htdocs\cake\apressblog\cake\console\controllers\news_cont
roller.php
Wrote `C:\xampp\htdocs\cake\apressblog\cake\console\controllers\news_controller.
php`

You can download SimpleTest from http://simpletest.org
Bake is detecting possible fixtures..

Warning: include_once(C:\xampp\htdocs\cake\apressblog\cake\console\config\databa
se.php): failed to open stream: No such file or directory in C:\xampp\htdocs\cak
e\apressblog\cake\libs\model\connection_manager.php on line 23

Warning: include_once(): Failed opening 'C:\xampp\htdocs\cake\apressblog\cake\co
nsole\config\database.php' for inclusion (include_path='.;\xampp\php\PEAR') in C
:\xampp\htdocs\cake\apressblog\cake\libs\model\connection_manager.php on line 23


Fatal error: ConnectionManager::getDataSource - Non-existent data source default
 in C:\xampp\htdocs\cake\apressblog\cake\libs\model\connection_manager.php on li
ne 102


C:\xampp\htdocs\cake\apressblog\cake\console>
+1  A: 

You need to create your database.php file in the config folder so that Cake knows what database to connect to for the models.

Once you have done this you need to create your database schema and then bake the model for it.

ABailiss