Exemplo n.º 1
0
 function httpHttp()
 {
     if ($this->isListMode === false) {
         //if($this->element->gson === false){
         $object = $this->httpObject();
         //}
     } else {
         //if($this->element->gson === false){
         $object = $this->httpObjectList();
         //}
     }
     $HttpKey = $this->getHttpKey();
     $note = parent::getNoteFormat();
     $http = $HttpKey[DataHttpElement::HTTP_KEY_HTTP];
     $http = parent::getFileContents($http);
     $http = str_replace(Element::FORMAT_CLASS, $this->name, $http);
     $data = "";
     $params = "";
     if (is_array($this->value)) {
         foreach ($this->value as $key => $value) {
             $element = $this->getElement();
             $element->initElement($key, $value, $this->getNoteElement($key));
             $data = $data . $element->http();
             $this->addStaticParams($element);
             if ($element->type != DataHttpElement::HTTP_KEY_FILE) {
                 $urlparams = str_replace(Element::FORMAT_CLASS, $key, self::FORMAT_URL_PARAMS);
                 $urlparams = str_replace(Element::FORMAT_DATA_KEY, ucfirst($element->name), $urlparams);
                 $params .= $urlparams . ",";
             }
         }
     }
     if (!empty($params)) {
         $params = substr($params, 0, strlen($params) - 1);
     }
     $data .= $object;
     $http = str_replace(Element::FORMAT_DATA, $data, $http);
     $url = $this->element->url;
     $http = str_replace(DataHttpElement::HTTP_URL, $url, $http);
     $http = str_replace(DataHttpElement::HTTP_PARAMS, $params, $http);
     $post = $this->element->post;
     if ($post === false) {
         $http = str_replace(DataHttpElement::HTTP_POST, "false", $http);
     } else {
         $http = str_replace(DataHttpElement::HTTP_POST, "true", $http);
     }
     $cookie = $this->element->cookie;
     if ($cookie === false) {
         $http = str_replace(DataHttpElement::HTTP_COOKIE, "false", $http);
     } else {
         $http = str_replace(DataHttpElement::HTTP_COOKIE, "true", $http);
     }
     $getcookie = $this->element->getcookie;
     if ($getcookie === false) {
         $http = str_replace(DataHttpElement::HTTP_GETCOOKIE, "false", $http);
     } else {
         $http = str_replace(DataHttpElement::HTTP_GETCOOKIE, "true", $http);
     }
     $tab = $this->element->tab;
     if (empty($tab)) {
         $http = str_replace(DataHttpElement::HTTP_TAB, "null", $http);
     } else {
         $http = str_replace(DataHttpElement::HTTP_TAB, "\"{$tab}\"", $http);
     }
     $http = str_replace(Element::FORMAT_NOTE, $note, $http);
     $http = str_replace(Element::FORMAT_VERSION, $this->version, $http);
     $http = str_replace(self::FORMAT_STATIC, $this->getStaticParams(), $http);
     $result = $http;
     $fileurl = $this->getFileUrl($result, $this->name . ".swift");
     return $result;
 }
 function httpHttp()
 {
     $object = "";
     if ($this->isListMode === false) {
         $result = $this->httpResult();
         if ($this->element->gson === false) {
             $object = $this->httpObject();
         }
     } else {
         $result = $this->httpResultList();
         if ($this->element->gson === false) {
             $object = $this->httpObjectList();
         }
     }
     $HttpKey = $this->getHttpKey();
     $note = parent::getNoteFormat();
     $http = $HttpKey[DataHttpElement::HTTP_KEY_HTTP];
     $http = parent::getFileContents($http);
     $http = str_replace(Element::FORMAT_CLASS, $this->name, $http);
     $data = "";
     $params = "";
     if (is_array($this->value)) {
         foreach ($this->value as $key => $value) {
             $element = $this->getElement();
             $element->initElement($key, $value, $this->getNoteElement($key));
             $data = $data . $element->http();
             if ($element->type != DataHttpElement::HTTP_KEY_FILE) {
                 $params .= " + \"&{$key}=\" + m" . ucfirst($element->name);
             }
         }
     }
     $data .= $result . $object;
     $http = str_replace(Element::FORMAT_DATA, $data, $http);
     $url = $this->element->url;
     $http = str_replace(DataHttpElement::HTTP_URL, $url, $http);
     $http = str_replace(DataHttpElement::HTTP_PARAMS, $params, $http);
     $post = $this->element->post;
     if ($post === false) {
         $http = str_replace(DataHttpElement::HTTP_POST, "false", $http);
     } else {
         $http = str_replace(DataHttpElement::HTTP_POST, "true", $http);
     }
     $cookie = $this->element->cookie;
     if ($cookie === false) {
         $http = str_replace(DataHttpElement::HTTP_COOKIE, "false", $http);
     } else {
         $http = str_replace(DataHttpElement::HTTP_COOKIE, "true", $http);
     }
     $getcookie = $this->element->getcookie;
     if ($getcookie === false) {
         $http = str_replace(DataHttpElement::HTTP_GETCOOKIE, "false", $http);
     } else {
         $http = str_replace(DataHttpElement::HTTP_GETCOOKIE, "true", $http);
     }
     $tab = $this->element->tab;
     if (empty($tab)) {
         $http = str_replace(DataHttpElement::HTTP_TAB, "null", $http);
     } else {
         $http = str_replace(DataHttpElement::HTTP_TAB, "\"{$tab}\"", $http);
     }
     $http = str_replace(Element::FORMAT_NOTE, $note, $http);
     $http = str_replace(Element::FORMAT_VERSION, $this->version, $http);
     $header = str_replace(Element::FORMAT_DATA_KEY, $this->base_name, JAVA_NATIVE_HTTP_HEAD);
     $result = $header . $http;
     $fileurl = $this->getFileUrl($result, $this->name . ".java");
     return $result;
 }
 function httpHttp()
 {
     $object = "";
     if ($this->isListMode === false) {
         $result = $this->httpResult();
     } else {
         $result = $this->httpResultList();
     }
     $HttpKey = $this->getHttpKey();
     $note = parent::getNoteFormat();
     $http = $HttpKey[DataHttpElement::HTTP_KEY_HTTP];
     $http = parent::getFileContents($http);
     $MHttpKey = $this->getMHttpKey();
     $mhttp = $MHttpKey[DataHttpElement::HTTP_KEY_HTTP];
     $mhttp = parent::getFileContents($mhttp);
     $post = $this->element->post;
     if ($post === false) {
         $mhttp = str_replace(DataHttpElement::HTTP_POST, "false", $mhttp);
     } else {
         $mhttp = str_replace(DataHttpElement::HTTP_POST, "true", $mhttp);
     }
     $http = str_replace(Element::FORMAT_CLASS, $this->name, $http);
     $http = str_replace(Element::FORMAT_CLASS_UPPER, strtoupper($this->name), $http);
     $mhttp = str_replace(Element::FORMAT_CLASS, $this->name, $mhttp);
     $mhttp = str_replace(Element::FORMAT_CLASS_UPPER, strtoupper($this->name), $mhttp);
     $data = "";
     if (is_array($this->value)) {
         foreach ($this->value as $key => $value) {
             $element = $this->getElement();
             $element->initElement($key, $value, $this->getNoteElement($key));
             $data = $data . $element->http();
             $this->addFinalParams($element);
             $this->addStaticParams($element);
             $this->addMParamsData($element);
             $this->addParamsData($element);
         }
     }
     $data .= $result . $object;
     $http = str_replace(Element::FORMAT_DATA, $data, $http);
     $http = str_replace(self::FORMAT_FINAL, $this->getFinalParams(), $http);
     $http = str_replace(self::FORMAT_STATIC, $this->getStaticParams(), $http);
     $url = $this->element->url;
     $http = str_replace(DataHttpElement::HTTP_URL, $url, $http);
     $mhttp = str_replace(Element::FORMAT_DATA, $this->getMParams(), $mhttp);
     $mhttp = str_replace(DataHttpElement::HTTP_PARAMS, $this->getParams(), $mhttp);
     $cookie = $this->element->cookie;
     if ($cookie === false) {
         $mhttp = str_replace(DataHttpElement::HTTP_COOKIE, "false", $mhttp);
     } else {
         $mhttp = str_replace(DataHttpElement::HTTP_COOKIE, "true", $mhttp);
     }
     $getcookie = $this->element->getcookie;
     if ($getcookie === false) {
         $mhttp = str_replace(DataHttpElement::HTTP_GETCOOKIE, "false", $mhttp);
     } else {
         $mhttp = str_replace(DataHttpElement::HTTP_GETCOOKIE, "true", $mhttp);
     }
     $cache = $this->element->cache;
     if ($cache === false) {
         $mhttp = str_replace(DataHttpElement::HTTP_CACHE, "false", $mhttp);
     } else {
         $mhttp = str_replace(DataHttpElement::HTTP_CACHE, "true", $mhttp);
     }
     $tab = $this->element->tab;
     if (empty($tab)) {
         $mhttp = str_replace(DataHttpElement::HTTP_TAB, "@\"\"", $mhttp);
     } else {
         $mhttp = str_replace(DataHttpElement::HTTP_TAB, "@\"{$tab}\"", $mhttp);
     }
     $http = str_replace(Element::FORMAT_NOTE, $note, $http);
     $http = str_replace(Element::FORMAT_VERSION, $this->version, $http);
     $header = str_replace(Element::FORMAT_DATA_KEY, $this->base_name, IOS_HTTP_HEAD);
     $result = $header . $http;
     $fileurl = $this->getFileUrl($result, $this->name . ".h");
     $mhttp = str_replace(Element::FORMAT_NOTE, $note, $mhttp);
     $m_result = str_replace(Element::FORMAT_VERSION, $this->version, $mhttp);
     $fileurl = $this->getFileUrl($m_result, $this->name . ".m");
     $node = "<br /><br />--------------------------------【.m解释文件】--------------------------------";
     $result .= $node . $m_result;
     return $result;
 }