Skip to content

Instantly share code, notes, and snippets.

@cebe
Created March 19, 2012 20:39
Show Gist options
  • Save cebe/2126943 to your computer and use it in GitHub Desktop.
Save cebe/2126943 to your computer and use it in GitHub Desktop.
yii: run console command inside webapplication action
<?php
// ...
$runner=new CConsoleCommandRunner();
$runner->commands=array(
'commandName' => array(
'class' => 'application.commands.myCommand',
),
);
ob_start();
$runner->run(array(
'yiic',
'idbrights',
));
echo nl2br(htmlentities(ob_get_clean(), null, Yii::app()->charset));
Yii::app()->end();
@nakkara2514
Copy link

1234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment