正在显示
1 个修改的文件
包含
41 行增加
和
0 行删除
| @@ -74,6 +74,47 @@ class CountAllProject extends Command | @@ -74,6 +74,47 @@ class CountAllProject extends Command | ||
| 74 | return $res_data; | 74 | return $res_data; |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | + public function httpGetProxy($url){ | ||
| 78 | + $ip_port = $this->httpGet("http://proxy.globalso.com/get_proxy.php"); | ||
| 79 | + $ch1 = curl_init(); | ||
| 80 | + $timeout = 0; | ||
| 81 | + $proxy = 'http://'.$ip_port; // 替换为你的代理 IP 和端口 | ||
| 82 | + curl_setopt($ch1, CURLOPT_URL, $url); | ||
| 83 | + curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true); | ||
| 84 | + curl_setopt($ch1, CURLOPT_PROXY, $proxy); | ||
| 85 | + curl_setopt($ch1, CURLOPT_ENCODING, ''); | ||
| 86 | + curl_setopt($ch1, CURLOPT_MAXREDIRS, 10); | ||
| 87 | + curl_setopt($ch1, CURLOPT_HTTPHEADER, array()); | ||
| 88 | + curl_setopt($ch1, CURLOPT_CONNECTTIMEOUT, $timeout); | ||
| 89 | + curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, FALSE); | ||
| 90 | + curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, FALSE); | ||
| 91 | + curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, true); | ||
| 92 | + curl_setopt($ch1, CURLOPT_CUSTOMREQUEST, 'GET'); | ||
| 93 | + curl_setopt($ch1, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); | ||
| 94 | + $content = curl_exec($ch1); | ||
| 95 | + curl_close($ch1); | ||
| 96 | + return json_decode($content, true); | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + public function httpGet($url){ | ||
| 100 | + $ch1 = curl_init(); | ||
| 101 | + $timeout = 0; | ||
| 102 | + curl_setopt($ch1, CURLOPT_URL, $url); | ||
| 103 | + curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true); | ||
| 104 | + curl_setopt($ch1, CURLOPT_ENCODING, ''); | ||
| 105 | + curl_setopt($ch1, CURLOPT_MAXREDIRS, 10); | ||
| 106 | + curl_setopt($ch1, CURLOPT_HTTPHEADER, array()); | ||
| 107 | + curl_setopt($ch1, CURLOPT_CONNECTTIMEOUT, $timeout); | ||
| 108 | + curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, FALSE); | ||
| 109 | + curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, FALSE); | ||
| 110 | + curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, true); | ||
| 111 | + curl_setopt($ch1, CURLOPT_CUSTOMREQUEST, 'GET'); | ||
| 112 | + curl_setopt($ch1, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); | ||
| 113 | + $access_txt = curl_exec($ch1); | ||
| 114 | + curl_close($ch1); | ||
| 115 | + return $access_txt; | ||
| 116 | + } | ||
| 117 | + | ||
| 77 | public function sixProject(){ | 118 | public function sixProject(){ |
| 78 | $projectModel = new Project(); | 119 | $projectModel = new Project(); |
| 79 | $manageModel = new ManageHr(); | 120 | $manageModel = new ManageHr(); |
-
请 注册 或 登录 后发表评论