解决方案 »

  1.   

    用yiic 执行 CConsoleCommand
      

  2.   


    console.conf.php  需要import 'application.controllers.*'然后
    <?php
    class OrangeCommand extends CConsoleCommand
    {
    public function run($args)
    {
    $siteController = new SiteController('site');        $siteController->actionReadexcel();
    }


    }<?phpclass SiteController extends CController
    {
    public function actionReadexcel()
    {
    echo 'check';


    }调用