示例#1
0
 public static function init()
 {
     XiiVersion::run(self::XII_VERSION);
     if (self::$_init) {
         self::getConfig();
     }
 }
示例#2
0
 public static function init()
 {
     XiiVersion::run(self::XII_VERSION);
     if (self::$_init) {
         self::getConfig();
         self::$_sendFormat = strtolower(self::$_sendFormat);
     }
 }
示例#3
0
 public static function open()
 {
     XiiVersion::run(self::XII_VERSION);
     self::getConfig();
     self::$_session = Yii::$app->session;
     self::$_session->open();
     self::$_cookiesRead = Yii::$app->request->cookies;
     self::$_cookiesWrite = Yii::$app->response->cookies;
 }
示例#4
0
 public static function init()
 {
     XiiVersion::run(self::XII_VERSION);
     if (strnatcasecmp(phpversion(), '5.5.0') < 0) {
         XiiError::sendError(0, 'This Class need PHP 5.5 +');
         Yii::$app->end();
     }
     if (self::$_init) {
         self::getConfig();
     }
 }
示例#5
0
 public function init()
 {
     parent::init();
     XiiVersion::run(self::XII_VERSION);
     XiiError::open();
     XiiUser::open();
     switch (Yii::$app->request->getMethod()) {
         case 'GET':
             $this->_requestData = Yii::$app->request->get();
             $this->_requestIds = isset($this->_requestData['id']) ? $this->_requestData['id'] : '';
             break;
         case 'POST':
             $this->_requestData = Yii::$app->request->post();
             break;
         case 'PUT':
             parse_str(file_get_contents('php://input'), $put_vars);
             $this->_requestData = $put_vars;
             $this->_requestIds = Yii::$app->request->get();
             $this->_requestData = array_merge($this->_requestData, $this->_requestIds);
             break;
         case 'DELETE':
             parse_str(file_get_contents('php://input'), $put_vars);
             $this->_requestData = $put_vars;
             $this->_requestIds = Yii::$app->request->get();
             break;
         default:
             $this->_requestData = Null;
             break;
     }
     if (isset($this->_requestData[$this->_requestValidField])) {
         $this->_requestValidData[$this->_requestValidField] = $this->_requestData[$this->_requestValidField];
         unset($this->_requestData[$this->_requestValidField]);
     }
     if (isset($this->_requestData[$this->_responseTypeField])) {
         $this->_responseType = $this->_requestData[$this->_responseTypeField];
         unset($this->_requestData[$this->_responseTypeField]);
         XiiResponse::getFormat($this->_responseType);
     }
 }
示例#6
0
 public function init()
 {
     parent::init();
     XiiVersion::run(self::XII_VERSION);
     if ($this->modelClass === 'XiiAcPlus') {
         XiiError::sendError(0, 'The "modelClass" property must be set.');
         Yii::$app->end();
     }
     $this->_requestCurrent = Yii::$app->request->getMethod();
     XiiError::open();
     $this->_modelClass = new $this->modelClass();
     switch ($this->_requestCurrent) {
         case 'GET':
             $this->_requestData = Yii::$app->request->get();
             $this->_requestIds = isset($this->_requestData['id']) ? $this->_requestData['id'] : '';
             break;
         case 'POST':
             $this->_requestData = Yii::$app->request->post();
             break;
         case 'PUT':
             parse_str(file_get_contents('php://input'), $put_vars);
             $this->_requestData = $put_vars;
             $this->_requestIds = Yii::$app->request->get();
             $this->_requestData = array_merge($this->_requestData, $this->_requestIds);
             break;
         case 'DELETE':
             parse_str(file_get_contents('php://input'), $put_vars);
             $this->_requestData = $put_vars;
             $this->_requestIds = Yii::$app->request->get();
             break;
         default:
             $this->_requestData = Null;
             break;
     }
     if (isset($this->_requestData[$this->_requestValidField])) {
         $this->_requestValidData[$this->_requestValidField] = $this->_requestData[$this->_requestValidField];
         unset($this->_requestData[$this->_requestValidField]);
     }
 }
示例#7
0
 public static function init()
 {
     XiiVersion::run(self::XII_VERSION);
 }
示例#8
0
 public function init()
 {
     parent::init();
     self::getConfig();
     self::$_modelFields = array_keys(parent::getAttributes());
     XiiVersion::run(self::XII_VERSION);
 }