Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Loader)
- *
- * @ Version : 2.0.0.4
- * @ Author : DeZender
- * @ Release on : 21.10.2015
- * @ Official site : http://DeZender.Net
- *
- */
- function curl($opt, $ch = null, $is_close = true) {
- $headers = array();
- $header_function = function ($ch, $header) {
- static $headers;
- $_header = trim($header);
- $colonPos = strpos($_header, ":");
- if (0 < $colonPos) {
- $name = strtolower(substr($_header, 0, $colonPos));
- $val = preg_replace("/^\\W+/", "", substr($_header, $colonPos));
- $headers[$name] = $val;
- }
- return strlen($header);
- }
- ;
- $ch = isset($ch) ? $ch : curl_init();
- curl_setopt_array($ch, curl_get_options($opt));
- curl_setopt($ch, CURLOPT_HEADERFUNCTION, $header_function);
- $content = curl_exec($ch);
- $obj = new stdClass();
- if (isset($headers["content-type"]) && in_str($headers["content-type"], "application/json")) {
- $obj = (object)json_decode($content, false, 512, JSON_BIGINT_AS_STRING);
- }
- $obj->http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- $obj->http_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
- if (isset($opt["header_out"]) && $opt["header_out"]) {
- $obj->http_header_out = curl_getinfo($ch, CURLINFO_HEADER_OUT);
- }
- if (isset($opt["header"]) && $opt["header"]) {
- $obj->http_headers = $headers;
- }
- if ($is_close) {
- curl_close($ch);
- }
- $obj->content = $content;
- return $obj;
- }
- function multi_curl($opts, $callback = null, $rolling_window = 5) {
- $mh = curl_multi_init();
- $rolling_window = sizeof($opts) < $rolling_window ? sizeof($opts) : $rolling_window;
- $result = array();
- $keys = array();
- $_keys = array();
- $i = 0;
- $chans = array();
- $headers = array();
- $header_function = function ($ch, $header) {
- static $headers;
- $_header = trim($header);
- $colonPos = strpos($_header, ":");
- if (0 < $colonPos) {
- $name = strtolower(substr($_header, 0, $colonPos));
- $val = preg_replace("/^\\W+/", "", substr($_header, $colonPos));
- $headers[(string)$ch][$name] = $val;
- }
- return strlen($header);
- }
- ;
- foreach ($opts as $key => $opt) {
- if ($i < $rolling_window) {
- ......................................................
- ...........................
- ........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement