Skip to content

Instantly share code, notes, and snippets.

@cebe
Created March 19, 2012 20:39
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • 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