private function runCommand($dsn, $command, $data)
    {
        $runner=new CConsoleCommandRunner();
        $runner->commands=array(
            'migrate' => array(
                'class' => $command,
                'dsn' => $dsn,
                'interactive' => 0,
            ),
            'db'=>array(
                'class'=>'CDbConnection',
                'connectionString' => "mysql:host={$dsn['host']};dbname={$dsn['dbname']}",
                'emulatePrepare' => true,
                'username' => $dsn['username'],
                'password' => $dsn['password'],
                'charset' => 'utf8',
            ),
        );
        
        ob_start();
        $modules = array_filter(glob(Yii::app()->getBasePath().'/modules/*', GLOB_ONLYDIR));

        foreach ($modules as $module)
        {
            if (file_exists($module.'/commands'))
                $runner->addCommands($module.'/commands');
        }

        $runner->run($data);
        
        return htmlentities(ob_get_clean(), null, Yii::app()->charset);
    }
private function runCommand($dsn, $command, $data)
    {
        $runner=new CConsoleCommandRunner();
        $runner->commands=array(
            'migrate' => array(
                'class' => $command,
                'dsn' => $dsn,
                'interactive' => 0,
            ),
            'db'=>array(
                'class'=>'CDbConnection',
                'connectionString' => "mysql:host={$dsn['host']};dbname={$dsn['dbname']}",
                'emulatePrepare' => true,
                'username' => $dsn['username'],
                'password' => $dsn['password'],
                'charset' => 'utf8',
            ),
        );
        
        ob_start();
        $modules = array_filter(glob(Yii::app()->getBasePath().'/modules/*', GLOB_ONLYDIR));

        foreach ($modules as $module)
        {
            if (file_exists($module.'/commands'))
                $runner->addCommands($module.'/commands');
        }

        $runner->run($data);
        
        return htmlentities(ob_get_clean(), null, Yii::app()->charset);
    }
private function runCommand ( $ dsn , $ command , $ data ) { $ runner = new CConsoleCommandRunner ( ) ; $ runner -> commands = array ( 'migrate' => array ( 'class' => $ command , 'dsn' => $ dsn , 'interactive' => 0 , ) , 'db' => array ( 'class' => 'CDbConnection' , 'connectionString' => "mysql:host={$dsn['host']};dbname={$dsn['dbname']}" , 'emulatePrepare' => true , 'username' => $ dsn [ 'username' ] , 'password' => $ dsn [ 'password' ] , 'charset' => 'utf8' , ) , ) ; ob_start ( ) ; $ modules = array_filter ( glob ( Yii :: app ( ) -> getBasePath ( ) . '/modules/*' , GLOB_ONLYDIR ) ) ; foreach ( $ modules as $ module ) { if ( file_exists ( $ module . '/commands' ) ) $ runner -> addCommands ( $ module . '/commands' ) ; } $ runner -> run ( $ data ) ; return htmlentities ( ob_get_clean ( ) , null , Yii :: app ( ) -> charset ) ; }
Runs a given command
@param array $dsn        The DSN
@param string $command   The CLI command to run
@param array $data       The runner data to use
@return string
Runs a given command