With ConsoleCommand ,I can't use any model or db componet

This is my program.

<?php

/*

  • 系统定时程序管理程序

  • Author:Xiangwei.Guo

  • */

class CrontCommand extends CConsoleCommand

{

 /*


 * 每隔一月执行一次


 * Default:每月1号0点执行


 * */


public function actionEvery1Month() {


			


	&#036;reports =Report::model()-&gt;findAll();


}

}

And this is my config file :config/console.php

<?php

// This is the configuration for yiic console application.

// Any writable CConsoleApplication properties can be configured here.

return array(

'basePath'=&gt;dirname(__FILE__).DIRECTORY_SEPARATOR.'..',


'name'=&gt;'My Console Application',


'timeZone'=&gt;'Asia/Shanghai',


// application components


'components'=&gt;array(


	/*'db'=&gt;array(


		'connectionString' =&gt; 'sqlite:'.dirname(__FILE__).'/&#46;&#46;/data/testdrive.db',


	),*/


	// uncomment the following to use a MySQL database


	/*


	'db'=&gt;array(


		'connectionString' =&gt; 'mysql:host=localhost;dbname=testdrive',


		'emulatePrepare' =&gt; true,


		'username' =&gt; 'root',


		'password' =&gt; '',


		'charset' =&gt; 'utf8',


	),


	*/


	'db'=&gt;array(


		'connectionString' =&gt; 'mysql:host=192.168.55.184;dbname=ldc',


		'emulatePrepare' =&gt; true,


		'username' =&gt; 'root',


		'password' =&gt; 'root',


		'charset' =&gt; 'utf8',


	),


	'import'=&gt;array(


		'application.models.*',


		'application.components.*',


	),


),

);

This is how I am running my program: yiic cront every1month

[color="#FF0000"]But I got the errors:

:\xampp\htdocs\ldc\protected>yiic cront every1month

HP Error[2]: include(Report.php): failed to open stream: No such file or direct[/color]

ry

in file D:\xampp\htdocs\ldc\lib\yii\framework\YiiBase.php at line 418

[color="#FF0000"]0 D:\xampp\htdocs\ldc\lib\yii\framework\YiiBase.php(418): autoload()

1 unknown(0): autoload()[/color]

2 D:\xampp\htdocs\ldc\protected\commands\CrontCommand.php(48): spl_autoload_cal

()

3 unknown(0): CrontCommand->actionEvery1Month()

4 D:\xampp\htdocs\ldc\lib\yii\framework\console\CConsoleCommand.php(141): Refle

tionMethod->invokeArgs()

5 D:\xampp\htdocs\ldc\lib\yii\framework\console\CConsoleCommandRunner.php(65):

rontCommand->run()

6 D:\xampp\htdocs\ldc\lib\yii\framework\console\CConsoleApplication.php(91): CC

nsoleCommandRunner->run()

7 D:\xampp\htdocs\ldc\lib\yii\framework\base\CApplication.php(162): CConsoleApp

ication->processRequest()

8 D:\xampp\htdocs\ldc\lib\yii\framework\yiic.php(33): CConsoleApplication->run(

9 D:\xampp\htdocs\ldc\protected\yiic.php(8): require_once()

:\xampp\htdocs\ldc\protected>yiic cront every1month

HP Error[2]: include(Report.php): failed to open stream: No such file or direct

ry

in file D:\xampp\htdocs\ldc\lib\yii\framework\YiiBase.php at line 418

[color="#FF0000"]0 D:\xampp\htdocs\ldc\lib\yii\framework\YiiBase.php(418): autoload()

1 unknown(0): autoload()[/color]

2 D:\xampp\htdocs\ldc\protected\commands\CrontCommand.php(46): spl_autoload_cal

()

[color="#FF0000"]3 unknown(0): CrontCommand->actionEvery1Month()[/color]

4 D:\xampp\htdocs\ldc\lib\yii\framework\console\CConsoleCommand.php(141): Refle

tionMethod->invokeArgs()

5 D:\xampp\htdocs\ldc\lib\yii\framework\console\CConsoleCommandRunner.php(65):

rontCommand->run()

6 D:\xampp\htdocs\ldc\lib\yii\framework\console\CConsoleApplication.php(91): CC

nsoleCommandRunner->run()

7 D:\xampp\htdocs\ldc\lib\yii\framework\base\CApplication.php(162): CConsoleApp

ication->processRequest()

8 D:\xampp\htdocs\ldc\lib\yii\framework\yiic.php(33): CConsoleApplication->run(

9 D:\xampp\htdocs\ldc\protected\yiic.php(8): require_once()

I don’t know why it happens.What should I do to fix this.

in config/console.php

import element at wrong place,

try this:




<?php

return array(

	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

	'name'=>'My Console Application',

	'timeZone'=>'Asia/Shanghai',

	'import'=>array(

		'application.models.*',

		'application.components.*',

	),

	'components'=>array(

		'db'=>array(

			'connectionString' => 'mysql:host=192.168.55.184;dbname=ldc',

			'emulatePrepare' => true,

			'username' => 'root',

			'password' => 'root',

			'charset' => 'utf8',

		),

	),

);



I had fixed the error in /config/console.php yesterday.Then I could use the class in /components/,but I still could not use the class in /models/.

While the strange thing is that I can use it in this morning and I don’t do any thing.

Whatever ,Thank you!