3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Набор методов для запроса к API uCoz. Версия для uCoz PHP сервера * @author Sergey Driver86 Pugovkin <sergey@pugovk.in> – разработчик методов для запроса (php версия) * @author Dmitry Kiselev <api@ucoz.net> – модификация и адаптация под uAPI + images. api.ucoz.net * @version 2.2 от 15 августа 2016 – fixed POST for category */ /** Ссылка на ваш сайт в юкозе, для обращения к uAPI Обратите внимание, что нужно вводить с / на конце. Если у сайта есть прикрепленный домен – необходимо указывать его. Если же сайт доступен по wwww – сайт необходимо указывать вместе с www. Например: http://www.mywebsite.ucoz.ru/ или http://www.mywebsite.com/ */ $myWebsite = 'https://utemplate.pro/'; /** Закончили формировать ссылку */ class Request { /** * Настройки * @var array */ public $config; /** * Обязательные параметры, передаваемые через URL при запросе к API * @var array */ private $params; /** * Конструктор класса * @param array $config Настройки */ function __construct($config = array()) { $this->config = $config; $this->params = array( 'oauth_version' => '1.0', 'oauth_timestamp' => time(), 'oauth_nonce' => md5(microtime() . mt_rand()), 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_consumer_key' => $this->config['oauth_consumer_key'], 'oauth_token' => $this->config['oauth_token'], ); } /** * Создание подписи запроса * @param string $method Метод запроса, например GET * @param string $url URL запроса, например /blog * @param string $params Все параметры, передаваемые через URL при запросе к API * @return string */ private function getSignature($method, $url, $params) { ksort($params); $baseString = strtoupper($method) . '&' . urlencode($url) . '&' . urlencode(strtr(http_build_query($params), array ('+' => '%20'))); return urlencode(base64_encode(hash_hmac('sha1', $baseString, $this->config['oauth_consumer_secret'] . '&' . $this->config['oauth_token_secret'], true))); } /** * Возвращает базовое имя файла для использования в подписи запроса * @param array $match Совпадения при поиске по регулярному выражению preg_replace_callback * @return string */ private function getBaseName($match) { return basename($match[1]); } /** * Запрос к API методом GET * @param string $url URL запроса, например /blog * @param array $data Массив данных * @return array */ public function get($url, $data = array()) { global $myWebsite; $this->params['oauth_nonce'] = md5(microtime() . mt_rand()); $url = $myWebsite.'uapi' . trim(strtolower($url), '').''; $queryString = http_build_query($this->params + $data + array('oauth_signature' => $this->getSignature('GET', $url, $this->params + $data))); $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_URL, $url . '?' . $queryString); $result = curl_exec($curl); curl_close($curl); return $result; } /** * Запрос к API методом POST * @param string $url URL запроса, например /blog * @param array $data Массив данных * @return array */ public function post($url, $data) { global $myWebsite; $this->params['oauth_nonce'] = md5(microtime() . mt_rand()); /** Делаем так, чтобы изображения при отправке отправлялись, а не валились в инвалид сигнутаре */ $x=1; while ($x<50) { if(empty($data['file'.$x])) break; $getfile1others = basename($data['file'.$x]); $findme = '@'; $pos = strpos($getfile1others, $findme); if ($pos === false) { $getfile1shop_array = array( 'file'.$x => '@'.$getfile1others ); } else { $getfile1shop_array = array( 'file'.$x => ''.$getfile1others ); } unset($data['file'.$x]); $data = array_merge($getfile1shop_array, $data); $x++; } if(!empty($data['file_add_cnt'])) { $allcountfilesshop = $data['file_add_cnt']; } if ($url == '/shop/editgoods') { $i= $allcountfilesshop; while ($i<50) { if(empty($data['file_add_'.$i]) && $data['file_add_'.$i] != 'file_add_cnt') break; $getfile1shop = basename($data['file_add_'.$i]); $findme = '@'; $pos = strpos($getfile1shop, $findme); if ($pos === false) { $getfile1shop_array = array( 'file_add_'.$i => '@'.$getfile1shop ); } else { $getfile1shop_array = array( 'file_add_'.$i => ''.$getfile1shop ); } unset($data['file_add_'.$i]); $data = array_merge($getfile1shop_array, $data); $i++; } } $url = $myWebsite.'uapi' . trim(strtolower($url), '').'/'; $sign = array('oauth_signature' => $this->getSignature('POST', $url, $this->params + preg_replace_callback('/^@(.+)$/', array($this, 'getBaseName'), $data))); $queryString = http_build_query($sign); $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_URL, $url . '?' . $forcurlpost); curl_setopt($curl, CURLOPT_POST, true); $forcurlpost = array_merge($this->params + $data, $sign); curl_setopt($curl, CURLOPT_POSTFIELDS, $forcurlpost); $result = curl_exec($curl); curl_close($curl); return $result; } /** * Запрос к API методом PUT * @param string $url URL запроса, например /blog * @param array $data Массив данных * @return array */ public function put($url, $data) { global $myWebsite; $this->params['oauth_nonce'] = md5(microtime() . mt_rand()); /** Делаем так, чтобы изображения при отправке отправлялись, а не валились в инвалид сигнутаре */ $x=1; while ($x<50) { if(empty($data['file'.$x])) break; $getfile1others = basename($data['file'.$x]); $findme = '@'; $pos = strpos($getfile1others, $findme); if ($pos === false) { $getfile1shop_array = array( 'file'.$x => '@'.$getfile1others ); } else { $getfile1shop_array = array( 'file'.$x => ''.$getfile1others ); } unset($data['file'.$x]); $data = array_merge($getfile1shop_array, $data); $x++; } if(!empty($data['file_add_cnt'])) { $allcountfilesshop = $data['file_add_cnt']; } if ($url == '/shop/editgoods') { $i= $allcountfilesshop; while ($i<50) { if(empty($data['file_add_'.$i]) && $data['file_add_'.$i] != 'file_add_cnt') break; $getfile1shop = basename($data['file_add_'.$i]); $findme = '@'; $pos = strpos($getfile1shop, $findme); if ($pos === false) { $getfile1shop_array = array( 'file_add_'.$i => '@'.$getfile1shop ); } else { $getfile1shop_array = array( 'file_add_'.$i => ''.$getfile1shop ); } unset($data['file_add_'.$i]); $data = array_merge($getfile1shop_array, $data); $i++; } } $url = $myWebsite.'uapi' . trim(strtolower($url), '').'/'; $sign = array('oauth_signature' => $this->getSignature('PUT', $url, $this->params + preg_replace_callback('/^@(.+)$/', array($this, 'getBaseName'), $data))); $queryString = http_build_query($sign); $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_URL, $url . '?' . $queryString); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT'); $forcurlpost = array_merge($this->params + $data, $sign); curl_setopt($curl, CURLOPT_POSTFIELDS, $forcurlpost); $result = curl_exec($curl); curl_close($curl); return $result; } /** * Запрос к API методом DELETE * @param string $url URL запроса, например /blog * @param array $data Массив данных * @return array */ public function delete($url, $data) { global $myWebsite; $this->params['oauth_nonce'] = md5(microtime() . mt_rand()); $url = $myWebsite.'uapi' . trim(strtolower($url), '').'/'; $queryString = http_build_query($this->params + $data + array('oauth_signature' => $this->getSignature('DELETE', $url, $this->params + $data))); $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_URL, $url . '?' . $queryString); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE'); $result = json_decode(curl_exec($curl), true); curl_close($curl); return $result; } } // ============================================================== // до сюда нельзя удалять error_reporting(E_ERROR) ; /** * Набор методов для запроса к API uCoz * @author Dmitry Kiselev <api@ucoz.net> – Демонстрация обращения к uAPImodule.php * @version 2.0 от 24 марта 2016 */ $request = new Request(array( 'oauth_consumer_key' => 'edl92g42SHm84bnRbZDW', 'oauth_consumer_secret' => 'wUClCAtSsjvCDs6nDR46zOYItvjKwn', 'oauth_token' => 'A9PL.uc1uujmmzFXmf13Gbeyx2BT1AEiVLiiOkLz', 'oauth_token_secret' => 'CWDmh4QfXOqzIXoEVfpPV9EUoSlEKjNEldItCgiD' )); // Используем // phpinfo(32); $x = '0'; $response = $request->get('/shop/invoices/', array( 'page' => 0, 'id' => '49938,49937,49936,49935,49934,49933,49932,49931,49918,49915,49905,49904,49893,49867,49866,49865,49864,49861,49853,49852,49846,49845,49842,49833,49832,49831,49815,49814,49813,49801,49800,49799,49798,49797,49796,49795,49769,49768,49767,49766,49759,49744,49737,49736,49735,49720,49719,49718,49717,49716,49715,49687,49686,49675,49674,49673,49672,49660,49659,49658,49657,49652,49645,49644,49643,49642,49633,49632,49619,49618,49617,49616,49600,49599,49598,49586,49585,49583,49580,49576,49575,49574,49559,49555,49554,49553,49552,49551,49550,49549,49548,49547,49546,49545,49544,49543,49542,49541,49540,49539,49538,49536,49535,49534,49533' )); $response = json_decode($response, true); //echo '<pre>'; //print_r($response); //echo '</pre>'; while ($x<21) //2090 { $response2 = $request->get('/shop/order/', array( 'order' => $response['success']['orders'][$x]['order_hash'] )); $response2 = json_decode($response2, true); // $response = $request->get('/shop/invoices/', array( // 'page' => $x, // 'id' => '40359,40360,40361,40366,40367,40368,40369,40394,40395,40396,40399,40400,40401,40402,40403,40406,40412,40413,40414,40415,40416,40432,40433,40434,40435,40448,40449,40453,40454,40455,40465,40466,40467,40471,40472,40473,40474,40475,40476,40483,40484,40485,40486,40487,40509,40510,40511,40535,40536,40537,40538,40539,40577,40578,40579,40581,40582,40583,40605,40606,40607,40608,40609,40610,40625,40626,40627,40646,40647,40648,40649,40650,40662,40663,40664,40665,40666,40667,40690,40691,40693,40694,40707,40708,40709,40710,40711,40712,40713,40714,40715,40727,40728,40729,40730,40731,40732,40744,40747,40748,40759,40760,40761,40768,40769,40782,40785,40786,40787,40806,40821,40822,40823,40826,40827,40855,40858,40859,40860,40861,40862,40863,40878,40879,40882,40883,40884,40885,40886,40891,40893,40911,40912,40913,40914,40915,40916,40928,40929,40930,40931,40963,40964,40965,40966,40967,40968,40969,40974,40975,40976' // )); // echo '<pre>'; // print_r(json_decode($response, true)); // echo '</pre>'; // нам нужны profit, id, // echo '<br />'.$response['success']['orders'][$page]['order_hash'].'<br />'; // echo '<pre>'; // print_r(json_decode($response2, true)); // echo '</pre>'; $goods_id = $response2['success']['order_digital_goods']['goods'][0]['id']; $name = $response2['success']['order_goods']['goods'][$goods_id]['added_user']; $price = $response2['success']['order_goods']['goods'][$goods_id]['price']['price_raw']; $num = $response2['success']['order_nom']; $howmusch = '0'; echo ' <table> <tr> <td>'.$num.'</td> <td>'.$name.'</td> <td>'.$price.'</td> </tr> </table> '; $x++; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
2 jumps found. (Code = 44) Position 1 = 68, Position 2 = 20
Branch analysis from position: 68
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 68, Position 2 = 20
Branch analysis from position: 68
Branch analysis from position: 20
filename:       /in/J4o3X
function name:  (null)
number of ops:  69
compiled vars:  !0 = $myWebsite, !1 = $request, !2 = $x, !3 = $response, !4 = $response2, !5 = $goods_id, !6 = $name, !7 = $price, !8 = $num, !9 = $howmusch
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, 'https%3A%2F%2Futemplate.pro%2F'
  277     1        INIT_FCALL                                               'error_reporting'
          2        SEND_VAL                                                 1
          3        DO_ICALL                                                 
  284     4        NEW                                              $12     'Request'
  285     5        SEND_VAL_EX                                              <array>
          6        DO_FCALL                                      0          
  284     7        ASSIGN                                                   !1, $12
  293     8        ASSIGN                                                   !2, '0'
  296     9        INIT_METHOD_CALL                                         !1, 'get'
         10        SEND_VAL_EX                                              '%2Fshop%2Finvoices%2F'
  297    11        SEND_VAL_EX                                              <array>
         12        DO_FCALL                                      0  $16     
  296    13        ASSIGN                                                   !3, $16
  301    14        INIT_FCALL                                               'json_decode'
         15        SEND_VAR                                                 !3
         16        SEND_VAL                                                 <true>
         17        DO_ICALL                                         $18     
         18        ASSIGN                                                   !3, $18
  307    19      > JMP                                                      ->66
  310    20    >   INIT_METHOD_CALL                                         !1, 'get'
         21        SEND_VAL_EX                                              '%2Fshop%2Forder%2F'
  311    22        FETCH_DIM_R                                      ~20     !3, 'success'
         23        FETCH_DIM_R                                      ~21     ~20, 'orders'
         24        FETCH_DIM_R                                      ~22     ~21, !2
         25        FETCH_DIM_R                                      ~23     ~22, 'order_hash'
         26        INIT_ARRAY                                       ~24     ~23, 'order'
         27        SEND_VAL_EX                                              ~24
         28        DO_FCALL                                      0  $25     
  310    29        ASSIGN                                                   !4, $25
  313    30        INIT_FCALL                                               'json_decode'
         31        SEND_VAR                                                 !4
         32        SEND_VAL                                                 <true>
         33        DO_ICALL                                         $27     
         34        ASSIGN                                                   !4, $27
  330    35        FETCH_DIM_R                                      ~29     !4, 'success'
         36        FETCH_DIM_R                                      ~30     ~29, 'order_digital_goods'
         37        FETCH_DIM_R                                      ~31     ~30, 'goods'
         38        FETCH_DIM_R                                      ~32     ~31, 0
         39        FETCH_DIM_R                                      ~33     ~32, 'id'
         40        ASSIGN                                                   !5, ~33
  331    41        FETCH_DIM_R                                      ~35     !4, 'success'
         42        FETCH_DIM_R                                      ~36     ~35, 'order_goods'
         43        FETCH_DIM_R                                      ~37     ~36, 'goods'
         44        FETCH_DIM_R                                      ~38     ~37, !5
         45        FETCH_DIM_R                                      ~39     ~38, 'added_user'
         46        ASSIGN                                                   !6, ~39
  332    47        FETCH_DIM_R                                      ~41     !4, 'success'
         48        FETCH_DIM_R                                      ~42     ~41, 'order_goods'
         49        FETCH_DIM_R                                      ~43     ~42, 'goods'
         50        FETCH_DIM_R                                      ~44     ~43, !5
         51        FETCH_DIM_R                                      ~45     ~44, 'price'
         52        FETCH_DIM_R                                      ~46     ~45, 'price_raw'
         53        ASSIGN                                                   !7, ~46
  333    54        FETCH_DIM_R                                      ~48     !4, 'success'
         55        FETCH_DIM_R                                      ~49     ~48, 'order_nom'
         56        ASSIGN                                                   !8, ~49
  334    57        ASSIGN                                                   !9, '0'
  338    58        CONCAT                                           ~52     '+%3Ctable%3E%0A++%3Ctr%3E%0A%0A++%09%3Ctd%3E', !8
         59        CONCAT                                           ~53     ~52, '%3C%2Ftd%3E%0A++++%3Ctd%3E'
  339    60        CONCAT                                           ~54     ~53, !6
         61        CONCAT                                           ~55     ~54, '%3C%2Ftd%3E%0A++++%3Ctd%3E'
  340    62        CONCAT                                           ~56     ~55, !7
         63        CONCAT                                           ~57     ~56, '%3C%2Ftd%3E%0A++%3C%2Ftr%3E%0A%3C%2Ftable%3E+'
         64        ECHO                                                     ~57
  344    65        PRE_INC                                                  !2
  307    66    >   IS_SMALLER                                               !2, 21
         67      > JMPNZ                                                    ~59, ->20
  347    68    > > RETURN                                                   1

Class Request:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J4o3X
function name:  __construct
number of ops:  26
compiled vars:  !0 = $config
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   RECV_INIT                                        !0      <array>
   37     1        ASSIGN_OBJ                                               'config'
          2        OP_DATA                                                  !0
   39     3        INIT_ARRAY                                       ~3      '1.0', 'oauth_version'
   40     4        INIT_FCALL                                               'time'
          5        DO_ICALL                                         $4      
          6        ADD_ARRAY_ELEMENT                                ~3      $4, 'oauth_timestamp'
   41     7        INIT_FCALL                                               'md5'
          8        INIT_FCALL                                               'microtime'
          9        DO_ICALL                                         $5      
         10        INIT_FCALL                                               'mt_rand'
         11        DO_ICALL                                         $6      
         12        CONCAT                                           ~7      $5, $6
         13        SEND_VAL                                                 ~7
         14        DO_ICALL                                         $8      
         15        ADD_ARRAY_ELEMENT                                ~3      $8, 'oauth_nonce'
   42    16        ADD_ARRAY_ELEMENT                                ~3      'HMAC-SHA1', 'oauth_signature_method'
   43    17        FETCH_OBJ_R                                      ~9      'config'
         18        FETCH_DIM_R                                      ~10     ~9, 'oauth_consumer_key'
         19        ADD_ARRAY_ELEMENT                                ~3      ~10, 'oauth_consumer_key'
   44    20        FETCH_OBJ_R                                      ~11     'config'
         21        FETCH_DIM_R                                      ~12     ~11, 'oauth_token'
         22        ADD_ARRAY_ELEMENT                                ~3      ~12, 'oauth_token'
   38    23        ASSIGN_OBJ                                               'params'
   44    24        OP_DATA                                                  ~3
   46    25      > RETURN                                                   null

End of function __construct

Function getsignature:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J4o3X
function name:  getSignature
number of ops:  47
compiled vars:  !0 = $method, !1 = $url, !2 = $params, !3 = $baseString
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   55     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   56     3        INIT_FCALL                                               'ksort'
          4        SEND_REF                                                 !2
          5        DO_ICALL                                                 
   57     6        INIT_FCALL                                               'strtoupper'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        CONCAT                                           ~6      $5, '%26'
         10        INIT_FCALL                                               'urlencode'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $7      
         13        CONCAT                                           ~8      ~6, $7
         14        CONCAT                                           ~9      ~8, '%26'
         15        INIT_FCALL                                               'urlencode'
         16        INIT_FCALL                                               'strtr'
         17        INIT_FCALL                                               'http_build_query'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $10     
         20        SEND_VAR                                                 $10
         21        SEND_VAL                                                 <array>
         22        DO_ICALL                                         $11     
         23        SEND_VAR                                                 $11
         24        DO_ICALL                                         $12     
         25        CONCAT                                           ~13     ~9, $12
         26        ASSIGN                                                   !3, ~13
   58    27        INIT_FCALL                                               'urlencode'
         28        INIT_FCALL                                               'base64_encode'
         29        INIT_FCALL                                               'hash_hmac'
         30        SEND_VAL                                                 'sha1'
         31        SEND_VAR                                                 !3
         32        FETCH_OBJ_R                                      ~15     'config'
         33        FETCH_DIM_R                                      ~16     ~15, 'oauth_consumer_secret'
         34        CONCAT                                           ~17     ~16, '%26'
         35        FETCH_OBJ_R                                      ~18     'config'
         36        FETCH_DIM_R                                      ~19     ~18, 'oauth_token_secret'
         37        CONCAT                                           ~20     ~17, ~19
         38        SEND_VAL                                                 ~20
         39        SEND_VAL                                                 <true>
         40        DO_ICALL                                         $21     
         41        SEND_VAR                                                 $21
         42        DO_ICALL                                         $22     
         43        SEND_VAR                                                 $22
         44        DO_ICALL                                         $23     
         45      > RETURN                                                   $23
   59    46*     > RETURN                                                   null

End of function getsignature

Function getbasename:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J4o3X
function name:  getBaseName
number of ops:  7
compiled vars:  !0 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   66     0  E >   RECV                                             !0      
   67     1        INIT_FCALL                                               'basename'
          2        FETCH_DIM_R                                      ~1      !0, 1
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
   68     6*     > RETURN                                                   null

End of function getbasename

Function get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/J4o3X
function name:  get
number of ops:  72
compiled vars:  !0 = $url, !1 = $data, !2 = $myWebsite, !3 = $queryString, !4 = $curl, !5 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   76     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
   77     2        BIND_GLOBAL                                              !2, 'myWebsite'
   78     3        INIT_FCALL                                               'md5'
          4        INIT_FCALL                                               'microtime'
          5        DO_ICALL                                         $8      
          6        INIT_FCALL                                               'mt_rand'
          7        DO_ICALL                                         $9      
          8        CONCAT                                           ~10     $8, $9
          9        SEND_VAL                                                 ~10
         10        DO_ICALL                                         $11     
         11        FETCH_OBJ_W                                      $6      'params'
         12        ASSIGN_DIM                                               $6, 'oauth_nonce'
         13        OP_DATA                                                  $11
   79    14        CONCAT                                           ~12     !2, 'uapi'
         15        INIT_FCALL                                               'trim'
         16        INIT_FCALL                                               'strtolower'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $13     
         19        SEND_VAR                                                 $13
         20        SEND_VAL                                                 ''
         21        DO_ICALL                                         $14     
         22        CONCAT                                           ~15     ~12, $14
         23        CONCAT                                           ~16     ~15, ''
         24        ASSIGN                                                   !0, ~16
   80    25        INIT_FCALL                                               'http_build_query'
         26        FETCH_OBJ_R                                      ~18     'params'
         27        ADD                                              ~19     ~18, !1
         28        INIT_METHOD_CALL                                         'getSignature'
         29        SEND_VAL                                                 'GET'
         30        SEND_VAR                                                 !0
         31        FETCH_OBJ_R                                      ~20     'params'
         32        ADD                                              ~21     ~20, !1
         33        SEND_VAL                                                 ~21
         34        DO_FCALL                                      0  $22     
         35        INIT_ARRAY                                       ~23     $22, 'oauth_signature'
         36        ADD                                              ~24     ~19, ~23
         37        SEND_VAL                                                 ~24
         38        DO_ICALL                                         $25     
         39        ASSIGN                                                   !3, $25
   81    40        INIT_FCALL_BY_NAME                                       'curl_init'
         41        DO_FCALL                                      0  $27     
         42        ASSIGN                                                   !4, $27
   82    43        INIT_FCALL_BY_NAME                                       'curl_setopt'
         44        SEND_VAR_EX                                              !4
         45        FETCH_CONSTANT                                   ~29     'CURLOPT_RETURNTRANSFER'
         46        SEND_VAL_EX                                              ~29
         47        SEND_VAL_EX                                              <true>
         48        DO_FCALL                                      0          
   83    49        INIT_FCALL_BY_NAME                                       'curl_setopt'
         50        SEND_VAR_EX                                              !4
         51        FETCH_CONSTANT                                   ~31     'CURLOPT_FOLLOWLOCATION'
         52        SEND_VAL_EX                                              ~31
         53        SEND_VAL_EX                                              1
         54        DO_FCALL                                      0          
   84    55        INIT_FCALL_BY_NAME                                       'curl_setopt'
         56        SEND_VAR_EX                                              !4
         57        FETCH_CONSTANT                                   ~33     'CURLOPT_URL'
         58        SEND_VAL_EX                                              ~33
         59        CONCAT                                           ~34     !0, '%3F'
         60        CONCAT                                           ~35     ~34, !3
         61        SEND_VAL_EX                                              ~35
         62        DO_FCALL                                      0          
   85    63        INIT_FCALL_BY_NAME                                       'curl_exec'
         64        SEND_VAR_EX                                              !4
         65        DO_FCALL                                      0  $37     
         66        ASSIGN                                                   !5, $37
   86    67        INIT_FCALL_BY_NAME                                       'curl_close'
         68        SEND_VAR_EX                                              !4
         69        DO_FCALL                                      0          
   87    70      > RETURN                                                   !5
   88    71*     > RETURN                                                   null

End of function get

Function post:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 16
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 58
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 104
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 102
Branch analysis from position: 102
2 jumps found. (Code = 44) Position 1 = 104, Position 2 = 62
Branch analysis from position: 104
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
2 jumps found. (Code = 46) Position 1 = 65, Position 2 = 69
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 70, Position 2 = 71
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 104
Branch analysis from position: 104
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 85, Position 2 = 90
Branch analysis from position: 85
1 jumps found. (Code = 42) Position 1 = 94
Branch analysis from position: 94
2 jumps found. (Code = 44) Position 1 = 104, Position 2 = 62
Branch analysis from position: 104
Branch analysis from position: 62
Branch analysis from position: 90
2 jumps found. (Code = 44) Position 1 = 104, Position 2 = 62
Branch analysis from position: 104
Branch analysis from position: 62
Branch analysis from position: 69
Branch analysis from position: 104
Branch analysis from position: 58
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 39
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 16
Branch analysis from position: 53
Branch analysis from position: 16
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 16
Branch analysis from position: 53
Branch analysis from position: 16
filename:       /in/J4o3X
function name:  post
number of ops:  187
compiled vars:  !0 = $url, !1 = $data, !2 = $myWebsite, !3 = $x, !4 = $getfile1others, !5 = $findme, !6 = $pos, !7 = $getfile1shop_array, !8 = $allcountfilesshop, !9 = $i, !10 = $getfile1shop, !11 = $sign, !12 = $queryString, !13 = $curl, !14 = $forcurlpost, !15 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   96     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   97     2        BIND_GLOBAL                                              !2, 'myWebsite'
   98     3        INIT_FCALL                                               'md5'
          4        INIT_FCALL                                               'microtime'
          5        DO_ICALL                                         $18     
          6        INIT_FCALL                                               'mt_rand'
          7        DO_ICALL                                         $19     
          8        CONCAT                                           ~20     $18, $19
          9        SEND_VAL                                                 ~20
         10        DO_ICALL                                         $21     
         11        FETCH_OBJ_W                                      $16     'params'
         12        ASSIGN_DIM                                               $16, 'oauth_nonce'
         13        OP_DATA                                                  $21
  104    14        ASSIGN                                                   !3, 1
  105    15      > JMP                                                      ->51
  106    16    >   CONCAT                                           ~23     'file', !3
         17        ISSET_ISEMPTY_DIM_OBJ                         1          !1, ~23
         18      > JMPZ                                                     ~24, ->20
         19    > > JMP                                                      ->53
  107    20    >   INIT_FCALL                                               'basename'
         21        CONCAT                                           ~25     'file', !3
         22        FETCH_DIM_R                                      ~26     !1, ~25
         23        SEND_VAL                                                 ~26
         24        DO_ICALL                                         $27     
         25        ASSIGN                                                   !4, $27
  108    26        ASSIGN                                                   !5, '%40'
  109    27        INIT_FCALL                                               'strpos'
         28        SEND_VAR                                                 !4
         29        SEND_VAR                                                 !5
         30        DO_ICALL                                         $30     
         31        ASSIGN                                                   !6, $30
  110    32        TYPE_CHECK                                    4          !6
         33      > JMPZ                                                     ~32, ->39
  112    34    >   CONCAT                                           ~33     'file', !3
         35        CONCAT                                           ~34     '%40', !4
         36        INIT_ARRAY                                       ~35     ~34, ~33
  111    37        ASSIGN                                                   !7, ~35
         38      > JMP                                                      ->43
  116    39    >   CONCAT                                           ~37     'file', !3
         40        CONCAT                                           ~38     '', !4
         41        INIT_ARRAY                                       ~39     ~38, ~37
  115    42        ASSIGN                                                   !7, ~39
  119    43    >   CONCAT                                           ~41     'file', !3
         44        UNSET_DIM                                                !1, ~41
  120    45        INIT_FCALL                                               'array_merge'
         46        SEND_VAR                                                 !7
         47        SEND_VAR                                                 !1
         48        DO_ICALL                                         $42     
         49        ASSIGN                                                   !1, $42
  121    50        PRE_INC                                                  !3
  105    51    >   IS_SMALLER                                               !3, 50
         52      > JMPNZ                                                    ~45, ->16
  127    53    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~46     !1, 'file_add_cnt'
         54        BOOL_NOT                                         ~47     ~46
         55      > JMPZ                                                     ~47, ->58
  128    56    >   FETCH_DIM_R                                      ~48     !1, 'file_add_cnt'
         57        ASSIGN                                                   !8, ~48
  131    58    >   IS_EQUAL                                                 !0, '%2Fshop%2Feditgoods'
         59      > JMPZ                                                     ~50, ->104
  133    60    >   ASSIGN                                                   !9, !8
  134    61      > JMP                                                      ->102
  135    62    >   CONCAT                                           ~52     'file_add_', !9
         63        ISSET_ISEMPTY_DIM_OBJ                         1  ~53     !1, ~52
         64      > JMPZ_EX                                          ~53     ~53, ->69
         65    >   CONCAT                                           ~54     'file_add_', !9
         66        FETCH_DIM_R                                      ~55     !1, ~54
         67        IS_NOT_EQUAL                                     ~56     ~55, 'file_add_cnt'
         68        BOOL                                             ~53     ~56
         69    > > JMPZ                                                     ~53, ->71
         70    > > JMP                                                      ->104
  136    71    >   INIT_FCALL                                               'basename'
         72        CONCAT                                           ~57     'file_add_', !9
         73        FETCH_DIM_R                                      ~58     !1, ~57
         74        SEND_VAL                                                 ~58
         75        DO_ICALL                                         $59     
         76        ASSIGN                                                   !10, $59
  137    77        ASSIGN                                                   !5, '%40'
  138    78        INIT_FCALL                                               'strpos'
         79        SEND_VAR                                                 !10
         80        SEND_VAR                                                 !5
         81        DO_ICALL                                         $62     
         82        ASSIGN                                                   !6, $62
  139    83        TYPE_CHECK                                    4          !6
         84      > JMPZ                                                     ~64, ->90
  141    85    >   CONCAT                                           ~65     'file_add_', !9
         86        CONCAT                                           ~66     '%40', !10
         87        INIT_ARRAY                                       ~67     ~66, ~65
  140    88        ASSIGN                                                   !7, ~67
         89      > JMP                                                      ->94
  145    90    >   CONCAT                                           ~69     'file_add_', !9
         91        CONCAT                                           ~70     '', !10
         92        INIT_ARRAY                                       ~71     ~70, ~69
  144    93        ASSIGN                                                   !7, ~71
  148    94    >   CONCAT                                           ~73     'file_add_', !9
         95        UNSET_DIM                                                !1, ~73
  149    96        INIT_FCALL                                               'array_merge'
         97        SEND_VAR                                                 !7
         98        SEND_VAR                                                 !1
         99        DO_ICALL                                         $74     
        100        ASSIGN                                                   !1, $74
  150   101        PRE_INC                                                  !9
  134   102    >   IS_SM

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
255.74 ms | 1433 KiB | 50 Q