functions.php
changeset 9 63a257541313
parent 8 a8d108f37363
child 13 b5db2345c397
equal deleted inserted replaced
8:a8d108f37363 9:63a257541313
    22  * @param string Error message
    22  * @param string Error message
    23  */
    23  */
    24 
    24 
    25 function burnout($msg)
    25 function burnout($msg)
    26 {
    26 {
    27   echo "\x1B[31;1m[Greyhound] fatal: \x1B[37;1m";
    27   $h = @fopen('php://stderr', 'w');
    28   echo "$msg\x1B[0m\n";
    28   fwrite($h, "\x1B[31;1m[Greyhound] fatal: \x1B[37;1m");
       
    29   fwrite($h, "$msg\x1B[0m\n");
       
    30   fclose($h);
    29   exit(1);
    31   exit(1);
    30 }
    32 }
    31 
    33 
    32 /**
    34 /**
    33  * Print a stylized status message, compatible with Linux consoles
    35  * Print a stylized status message, compatible with Linux consoles
    34  * @param string Status message
    36  * @param string Status message
    35  */
    37  */
    36 
    38 
    37 function status($msg)
    39 function status($msg)
    38 {
    40 {
    39   echo "\x1B[32;1m[Greyhound] \x1B[32;0m$msg\x1B[0m\n";
    41   $h = @fopen('php://stderr', 'w');
       
    42   fwrite($h, "\x1B[32;1m[Greyhound] \x1B[32;0m$msg\x1B[0m\n");
       
    43   fclose($h);
    40 }
    44 }
    41 
    45 
    42 /**
    46 /**
    43  * Performs an action with DCOP.
    47  * Performs an action with DCOP.
    44  * @param string DCOP component, e.g. player, playlist, playlistbrowser, ...
    48  * @param string DCOP component, e.g. player, playlist, playlistbrowser, ...