2011-11-11 19 views

回答

14

你可能要檢查if is a CLI request:

class Mycontroller extends CI_Controller { 

    function __construct() 
    { 
    parent::__construct(); 

    if(!$this->input->is_cli_request()) 
    { 
     // echo 'Not allowed'; 
     // exit(); 
    } 
    } 

} 
+1

這就是我一直在尋找。謝謝。 – applechief