PHP Classes

File: utils.php

Recommend this page to a friend!
  Classes of Charalampos Pournaris   Torrent Pieces Hash Verification   utils.php   Download  
File: utils.php
Role: Auxiliary script
Content type: text/plain
Description: Utility functions
Class: Torrent Pieces Hash Verification
Compare downloaded data with torrent data
Author: By
Last change:
Date: 15 years ago
Size: 438 bytes
 

Contents

Class file image Download
<?php
/**
 * Utility function to print a message on stdout
 *
 * optionaly can stop the program execution ($fatal variable)
 *
 * @param string $message
 * @param boolean $fatal
 */
function printConsole($message, $fatal = false) {
    global
$output_file, $msgbuffer;
   
    if (!empty(
$output_file) && !$fatal) {
       
$msgbuffer .= $message."\n";
    } else {
        print (
$message . "\n" );
    }
   
    if (
$fatal)
        exit (
1 );
}
?>