@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public function login($all_data) |
| 20 | 20 | { |
| 21 | - if(isset($all_data["url"])) $url = $all_data["url"]; else throw new Exception("url is not exist in all_data"); |
|
| 22 | - if(isset($all_data["data"])) $data = $all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 23 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 24 | - if(isset($all_data["ret"])) $ret = $all_data["ret"]; else $ret = 'false'; |
|
| 25 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 21 | + if (isset($all_data["url"])) $url=$all_data["url"]; else throw new Exception("url is not exist in all_data"); |
|
| 22 | + if (isset($all_data["data"])) $data=$all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 23 | + if (isset($all_data["oj"])) $oj=$all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 24 | + if (isset($all_data["ret"])) $ret=$all_data["ret"]; else $ret='false'; |
|
| 25 | + if (isset($all_data["handle"])) $handle=$all_data["handle"]; else $handle="default"; |
|
| 26 | 26 | |
| 27 | 27 | $datapost=curl_init(); |
| 28 | 28 | $headers=array("Expect:"); |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | public function grab_page($all_data) |
| 56 | 56 | { |
| 57 | - if(isset($all_data["site"])) $site = $all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 58 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 59 | - if(isset($all_data["headers"])) $headers = $all_data["headers"]; else $headers = []; |
|
| 60 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 61 | - if(isset($all_data["follow"])) $follow = $all_data["follow"]; else $follow = false; |
|
| 57 | + if (isset($all_data["site"])) $site=$all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 58 | + if (isset($all_data["oj"])) $oj=$all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 59 | + if (isset($all_data["headers"])) $headers=$all_data["headers"]; else $headers=[]; |
|
| 60 | + if (isset($all_data["handle"])) $handle=$all_data["handle"]; else $handle="default"; |
|
| 61 | + if (isset($all_data["follow"])) $follow=$all_data["follow"]; else $follow=false; |
|
| 62 | 62 | |
| 63 | 63 | $handle=urlencode($handle); |
| 64 | 64 | |
@@ -85,15 +85,15 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | public function post_data($all_data) |
| 87 | 87 | { |
| 88 | - if(isset($all_data["site"])) $site = $all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 89 | - if(isset($all_data["data"])) $data = $all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 90 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 91 | - if(isset($all_data["ret"])) $ret = $all_data["ret"]; else $ret = false; |
|
| 92 | - if(isset($all_data["follow"])) $follow = $all_data["follow"]; else $follow = true; |
|
| 93 | - if(isset($all_data["returnHeader"])) $returnHeader = $all_data["returnHeader"]; else $returnHeader = true; |
|
| 94 | - if(isset($all_data["postJson"])) $postJson = $all_data["postJson"]; else $postJson = false; |
|
| 95 | - if(isset($all_data["extraHeaders"])) $extraHeaders = $all_data["extraHeaders"]; else $extraHeaders = []; |
|
| 96 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 88 | + if (isset($all_data["site"])) $site=$all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 89 | + if (isset($all_data["data"])) $data=$all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 90 | + if (isset($all_data["oj"])) $oj=$all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 91 | + if (isset($all_data["ret"])) $ret=$all_data["ret"]; else $ret=false; |
|
| 92 | + if (isset($all_data["follow"])) $follow=$all_data["follow"]; else $follow=true; |
|
| 93 | + if (isset($all_data["returnHeader"])) $returnHeader=$all_data["returnHeader"]; else $returnHeader=true; |
|
| 94 | + if (isset($all_data["postJson"])) $postJson=$all_data["postJson"]; else $postJson=false; |
|
| 95 | + if (isset($all_data["extraHeaders"])) $extraHeaders=$all_data["extraHeaders"]; else $extraHeaders=[]; |
|
| 96 | + if (isset($all_data["handle"])) $handle=$all_data["handle"]; else $handle="default"; |
|
| 97 | 97 | |
| 98 | 98 | $handle=urlencode($handle); |
| 99 | 99 | |
@@ -18,11 +18,31 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public function login($all_data) |
| 20 | 20 | { |
| 21 | - if(isset($all_data["url"])) $url = $all_data["url"]; else throw new Exception("url is not exist in all_data"); |
|
| 22 | - if(isset($all_data["data"])) $data = $all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 23 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 24 | - if(isset($all_data["ret"])) $ret = $all_data["ret"]; else $ret = 'false'; |
|
| 25 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 21 | + if(isset($all_data["url"])) { |
|
| 22 | + $url = $all_data["url"]; |
|
| 23 | + } else { |
|
| 24 | + throw new Exception("url is not exist in all_data"); |
|
| 25 | + } |
|
| 26 | + if(isset($all_data["data"])) { |
|
| 27 | + $data = $all_data["data"]; |
|
| 28 | + } else { |
|
| 29 | + throw new Exception("data is not exist in all_data"); |
|
| 30 | + } |
|
| 31 | + if(isset($all_data["oj"])) { |
|
| 32 | + $oj = $all_data["oj"]; |
|
| 33 | + } else { |
|
| 34 | + throw new Exception("oj is not exist in all_data"); |
|
| 35 | + } |
|
| 36 | + if(isset($all_data["ret"])) { |
|
| 37 | + $ret = $all_data["ret"]; |
|
| 38 | + } else { |
|
| 39 | + $ret = 'false'; |
|
| 40 | + } |
|
| 41 | + if(isset($all_data["handle"])) { |
|
| 42 | + $handle = $all_data["handle"]; |
|
| 43 | + } else { |
|
| 44 | + $handle = "default"; |
|
| 45 | + } |
|
| 26 | 46 | |
| 27 | 47 | $datapost=curl_init(); |
| 28 | 48 | $headers=array("Expect:"); |
@@ -54,11 +74,31 @@ discard block |
||
| 54 | 74 | |
| 55 | 75 | public function grab_page($all_data) |
| 56 | 76 | { |
| 57 | - if(isset($all_data["site"])) $site = $all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 58 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 59 | - if(isset($all_data["headers"])) $headers = $all_data["headers"]; else $headers = []; |
|
| 60 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 61 | - if(isset($all_data["follow"])) $follow = $all_data["follow"]; else $follow = false; |
|
| 77 | + if(isset($all_data["site"])) { |
|
| 78 | + $site = $all_data["site"]; |
|
| 79 | + } else { |
|
| 80 | + throw new Exception("site is not exist in all_data"); |
|
| 81 | + } |
|
| 82 | + if(isset($all_data["oj"])) { |
|
| 83 | + $oj = $all_data["oj"]; |
|
| 84 | + } else { |
|
| 85 | + throw new Exception("oj is not exist in all_data"); |
|
| 86 | + } |
|
| 87 | + if(isset($all_data["headers"])) { |
|
| 88 | + $headers = $all_data["headers"]; |
|
| 89 | + } else { |
|
| 90 | + $headers = []; |
|
| 91 | + } |
|
| 92 | + if(isset($all_data["handle"])) { |
|
| 93 | + $handle = $all_data["handle"]; |
|
| 94 | + } else { |
|
| 95 | + $handle = "default"; |
|
| 96 | + } |
|
| 97 | + if(isset($all_data["follow"])) { |
|
| 98 | + $follow = $all_data["follow"]; |
|
| 99 | + } else { |
|
| 100 | + $follow = false; |
|
| 101 | + } |
|
| 62 | 102 | |
| 63 | 103 | $handle=urlencode($handle); |
| 64 | 104 | |
@@ -85,15 +125,51 @@ discard block |
||
| 85 | 125 | |
| 86 | 126 | public function post_data($all_data) |
| 87 | 127 | { |
| 88 | - if(isset($all_data["site"])) $site = $all_data["site"]; else throw new Exception("site is not exist in all_data"); |
|
| 89 | - if(isset($all_data["data"])) $data = $all_data["data"]; else throw new Exception("data is not exist in all_data"); |
|
| 90 | - if(isset($all_data["oj"])) $oj = $all_data["oj"]; else throw new Exception("oj is not exist in all_data"); |
|
| 91 | - if(isset($all_data["ret"])) $ret = $all_data["ret"]; else $ret = false; |
|
| 92 | - if(isset($all_data["follow"])) $follow = $all_data["follow"]; else $follow = true; |
|
| 93 | - if(isset($all_data["returnHeader"])) $returnHeader = $all_data["returnHeader"]; else $returnHeader = true; |
|
| 94 | - if(isset($all_data["postJson"])) $postJson = $all_data["postJson"]; else $postJson = false; |
|
| 95 | - if(isset($all_data["extraHeaders"])) $extraHeaders = $all_data["extraHeaders"]; else $extraHeaders = []; |
|
| 96 | - if(isset($all_data["handle"])) $handle = $all_data["handle"]; else $handle = "default"; |
|
| 128 | + if(isset($all_data["site"])) { |
|
| 129 | + $site = $all_data["site"]; |
|
| 130 | + } else { |
|
| 131 | + throw new Exception("site is not exist in all_data"); |
|
| 132 | + } |
|
| 133 | + if(isset($all_data["data"])) { |
|
| 134 | + $data = $all_data["data"]; |
|
| 135 | + } else { |
|
| 136 | + throw new Exception("data is not exist in all_data"); |
|
| 137 | + } |
|
| 138 | + if(isset($all_data["oj"])) { |
|
| 139 | + $oj = $all_data["oj"]; |
|
| 140 | + } else { |
|
| 141 | + throw new Exception("oj is not exist in all_data"); |
|
| 142 | + } |
|
| 143 | + if(isset($all_data["ret"])) { |
|
| 144 | + $ret = $all_data["ret"]; |
|
| 145 | + } else { |
|
| 146 | + $ret = false; |
|
| 147 | + } |
|
| 148 | + if(isset($all_data["follow"])) { |
|
| 149 | + $follow = $all_data["follow"]; |
|
| 150 | + } else { |
|
| 151 | + $follow = true; |
|
| 152 | + } |
|
| 153 | + if(isset($all_data["returnHeader"])) { |
|
| 154 | + $returnHeader = $all_data["returnHeader"]; |
|
| 155 | + } else { |
|
| 156 | + $returnHeader = true; |
|
| 157 | + } |
|
| 158 | + if(isset($all_data["postJson"])) { |
|
| 159 | + $postJson = $all_data["postJson"]; |
|
| 160 | + } else { |
|
| 161 | + $postJson = false; |
|
| 162 | + } |
|
| 163 | + if(isset($all_data["extraHeaders"])) { |
|
| 164 | + $extraHeaders = $all_data["extraHeaders"]; |
|
| 165 | + } else { |
|
| 166 | + $extraHeaders = []; |
|
| 167 | + } |
|
| 168 | + if(isset($all_data["handle"])) { |
|
| 169 | + $handle = $all_data["handle"]; |
|
| 170 | + } else { |
|
| 171 | + $handle = "default"; |
|
| 172 | + } |
|
| 97 | 173 | |
| 98 | 174 | $handle=urlencode($handle); |
| 99 | 175 | |