$fp = fsockopen($thisHost, 80, $errno, $errstr, 30); if ($fp) { //строка http заголовков $out = "POST {$resendURL} HTTP/1.1\n"; $out .= "Host: " . $thisHost . "\n"; //$out .= "Content-Type: application/x-www-form-urlencoded\n"; $out .= "Content-Type: {$contentType}\n"; $out .= "Connection: close\n"; $out .= "Content-Length: " . strlen($encrypted_request) . "\n\n"; $out .= $encrypted_request . "\n\n"; @fputs($fp, $out); //отправляем POST запрос $respHtml = ''; while (!@feof($fp)) { $line = @fgets($fp, 1024); //читаем одну строку // outToLog(trim($line)); $respHtml .= $line; } fclose($fp); if (preg_match("/<!-- JSON BEGIN(.+)JSON END -->/", $respHtml, $matches)) { $respJsonStr = $matches[1]; echo $respJsonStr; } else { outToLog("#oos_notify: failed to find JSON in response from {$resendURL}"); http_response_code(500); } } else { outToLog("#oos_notify: failed making a http post to {$resendURL}"); http_response_code(500); }
public function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn) { outToLog('$htmlIn before = ' . print_r($htmlIn, true)); $display = $this->displayListFE($cart, $selected, $htmlIn); outToLog('$htmlIn after = ' . print_r($htmlIn, true)); return $display; }
function userJointHandler($errno, $errmsg, $filename, $linenum, $callStack, $errorType, $survive = false) { restore_error_handler(); // prevent recursion in error handling ! outToLog(true); // enable error logging ( localhost, or not) outWithBR(true); // enable <br>, just in case out(); // remove any non-file-associated handler notice from stack (to grab info on actual culprit) if (!isset($callStack[0]['file'])) { array_shift($callStack); } // remove any exception re-throw from stack (to grab info on actual culprit) if (0 == strcmp($callStack[0]['file'], __FILE__)) { array_shift($callStack); } $sourceLine = grabSourceLine($callStack[0]); // only be talkative on localhost or if (traceLive) explicitly wanted // ! survive means: be mute on silent errors outToScreen($GLOBALS['isLocalHost'] && !$survive); $aCallstack = array_reverse($callStack); foreach ($aCallstack as $aCall) { if (!isset($aCall['file'])) { $aCall['file'] = ''; } if (!isset($aCall['line'])) { $aCall['line'] = ''; } // FRANK TEMP BACKUP error_log("{$aCall["file"]}:{$aCall["line"]} {$aCall["function"]}(...)"); out("{$aCall["file"]}:{$aCall["line"]} {$aCall["function"]}(...)"); } out($sourceLine); out('----------------------------'); return false; // TEMPTEMP avoid running PHP's internal error handler }