예제 #1
0
     $hash = array(array('ID' => 0, 'key' => $spotnab->decompstr($keys['pubkey']), 'user' => 'nntp', 'email' => '*****@*****.**', 'ref' => $article[2]['Epoch'] - 1));
     // Fake headers (use debug information from encodePost)
     $headers = array($article[2]);
     $matched = $spotnab->process_comment_headers($headers, $hash, false);
     if ($matched !== false) {
         $inserted = $matched[0];
         $updated = $matched[1];
         echo $matched > 0 ? "Successful!\n" : "Failed!\n";
     } else {
         echo "Failed\n";
     }
 } else {
     printf("%s WARNING - openssl is not correctly installed; broadcasts and posts will be disabled.\n", date("Y-m-d H:i:s"));
 }
 printf("%s INFO - Testing UTC/Local conversions [1/6]...", date("Y-m-d H:i:s"));
 $refa = $spotnab->utc2local();
 $refb = $spotnab->utc2local($spotnab->local2utc($refa));
 echo $refa == $refb ? "Successful!\n" : "Failed!\n";
 printf("%s INFO - Testing UTC/Local conversions [2/6]...", date("Y-m-d H:i:s"));
 $refa = $spotnab->local2utc();
 $refb = $spotnab->local2utc($spotnab->utc2local($refa));
 echo $refa == $refb ? "Successful!\n" : "Failed!\n";
 printf("%s INFO - Testing UTC/Local conversions [3/6]...", date("Y-m-d H:i:s"));
 $refa = $spotnab->local2utc(date("Y-m-d H:i:s"));
 $refb = $spotnab->local2utc($spotnab->utc2local($refa));
 echo $refa == $refb ? "Successful!\n" : "Failed!\n";
 printf("%s INFO - Testing UTC/Local conversions [4/6]...", date("Y-m-d H:i:s"));
 $refa = $spotnab->utc2local(time());
 $refb = $spotnab->utc2local($spotnab->local2utc($refa));
 echo $refa == $refb ? "Successful!\n" : "Failed!\n";
 printf("%s INFO - Testing UTC/Local conversions [5/6]...", date("Y-m-d H:i:s"));