Example #1
0
 /**
  * 还原加密后的参数
  *
  * @param null|string $params
  * @return bool|string
  */
 protected function sParams($params = null)
 {
     $url_type = $this->getConfig()->get('url', 'type');
     if (null === $params) {
         switch ($url_type) {
             case 1:
             case 5:
                 $params = $this->params;
                 if (is_array($this->params)) {
                     $params = current(array_values($this->params));
                 }
                 break;
             case 2:
                 $params = current(array_keys($this->params));
                 break;
             case 3:
             case 4:
                 $params = current($this->params);
                 break;
         }
     }
     $result = array();
     $decode_params_str = false;
     if (is_string($params)) {
         $decode_params_str = $this->urlEncrypt($params, 'decode');
     }
     if (false == $decode_params_str) {
         return $this->params;
     }
     switch ($url_type) {
         case 1:
         case 5:
             $result_array = explode($this->getConfig()->get('url', 'dot'), $decode_params_str);
             $result = Application::combineParamsAnnotateConfig($result_array, self::$action_annotate['params']);
             break;
         case 2:
             parse_str($decode_params_str, $result);
             break;
         case 3:
         case 4:
             $result = Application::stringParamsToAssociativeArray($decode_params_str, $this->getConfig()->get('url', 'dot'));
             break;
     }
     return $result;
 }