View Full Version : pete_assert() Help

06-19-2010, 04:22 AM
Does anyone know what the pete_assert function does? I'm trying to use this code to do http asynchronous calling but it is erroring out on this pete_assert function. Fatal error: Call to undefined function pete_assert()

What is that?


function curl_post_async($url, $params)
foreach ($params as $key => &$val) {
if (is_array($val)) $val = implode(',', $val);
$post_params[] = $key.'='.urlencode($val);
$post_string = implode('&', $post_params);


$fp = fsockopen($parts['host'],
$errno, $errstr, 30);

pete_assert(($fp!=0), "Couldn't open a socket to ".$url." (".$errstr.")");

$out = "POST ".$parts['path']." HTTP/1.1\r\n";
$out.= "Host: ".$parts['host']."\r\n";
$out.= "Content-Type: application/x-www-form-urlencoded\r\n";
$out.= "Content-Length: ".strlen($post_string)."\r\n";
$out.= "Connection: Close\r\n\r\n";
if (isset($post_string)) $out.= $post_string;

fwrite($fp, $out);

06-19-2010, 09:30 AM
Seems like a copy/paste prevention, but concept revealing snippet. That is definitely a custom function and I honestly doubt anybody here is going to have a clue on what it does.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum