Shell - CConsoleCommand

Hello =)

I have a problem which makes me really sad.

I tried to start my auth.php with the yiic shell.

The file is under …\protected\commands\shell\ and I sue the yiic from my actual project.

But when I use:

Nothing happens. ALl I get from this mean tool is:

Code in auth.php




class RbacCommand extends CConsoleCommand

{

   public function run($args)

   {

        $auth=Yii::app()->authManager;

       

   

        $auth->createOperation('createPost','create a post');

        $auth->createOperation('readPost','read a post');

[...]



Anyone an idea whats going wrong?

Thanks for reading =)

Update:

When I use:

yiic.php -> yiic (php.exe is in my PATH)

So it seems, that I have to give some input, but I must confess, that wasnt my plan. ;)

The only difference I could see from my own (almost the same) installation is I have RBACCommand.php class(class RBACCommand extends CConsoleCommand), not auth.php and it works like a charm.

Why do you want to use the shell? It’s deprecated. If you need a console command, just rename your file to RbacCommand (same name as the class), move it to the protected/commands directory and run it with


./yiic rbac

More details here: http://www.yiiframework.com/doc/guide/1.1/en/topics.console

Hello evry body I need some help please:

I need to create a crontab command but i have a big problem :

in commands

<?php

class CronTestCommand extends CConsoleCommand{

public function actionImporter()

{

$connection=Yii::app()->dbtest;

$model = new User();

var_dump($model);

}

}

then in config/console.php

‘import’=>array(

‘application.models.*’,

‘application.components.*’,

‘application.modules.test.models.*’,

‘application.modules.test.components.*’,

),

but always i have this problem

PHP Error[2]: include(/var/www/lde_socle/protected/modules/test/modules/test/models/_base/BaseUser.php): failed to open stream: No such file or directory

in file /var/www/Yii/framework/YiiBase.php at line 404

#0 /var/www/Yii/framework/YiiBase.php(404): autoload()

#1 unknown(0): autoload()

#2 /var/www/lde_socle/protected/modules/test/models/Test.php(23): spl_autoload_call()

#3 /var/www/Yii/framework/YiiBase.php(432): include()

#4 unknown(0): autoload()

#5 /var/www/lde_socle/protected/modules/administration/commands/CronTestCommand.php(15): spl_autoload_call()

#6 unknown(0): CronTestCommand->actionImporter()

#7 /var/www/Yii/framework/console/CConsoleCommand.php(172): ReflectionMethod->invokeArgs()

#8 /var/www/Yii/framework/console/CConsoleCommandRunner.php(71): CronTestCommand->run()

#9 /var/www/Yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()

#10 /var/www/Yii/framework/base/CApplication.php(184): CConsoleApplication->processRequest()

#11 /var/www/Yii/framework/yiic.php(33): CConsoleApplication->run()

#12 /var/www/lde_socle/protected/modules/administration/yiic.php(36): require_once()

Any Help

Thank you !