示例#1
0
 public function __construct()
 {
     parent::__construct();
     $this->_input = fopen("php://stdin", "r");
     $this->_output = fopen("php://stdout", "w");
     $this->_color = new Color();
     $this->_reflect = new \ReflectionClass($this);
     $this->_command = Inflector::underscore(substr($this->_reflect->getShortName(), 0, -10));
     $this->_commandColor = '<bold><green>' . $this->_command . '</green></bold>';
     $this->writeln("Solve console v0.1\n");
 }
示例#2
0
 public function __construct()
 {
     parent::__construct();
     $this->_sessionToken = RemoteSessionManager::getSessionToken();
     $this->_sessionStorage = new SessionStorage(null, 'api_session');
     $this->_data = new ArrayStorage();
     $action = DC::getApplication()->getRoute()->getActionName();
     $action = substr($action, 0, -6);
     if (!in_array($action, $this->_unprotectedMethods)) {
         $this->requireAuthorization();
     }
 }
示例#3
0
 public function __construct()
 {
     parent::__construct();
     $this->view->setResponseFormat(View::FORMAT_JSON);
 }