forked from jiminald/PHP-Printer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Output_CLI.php
39 lines (33 loc) · 1.01 KB
/
Output_CLI.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Output class
*
* This uses the smarty templating system for the framework
* @access public
* @author Jiminald <[email protected]>
* @copyright Jiminald 18/May/2010
* @package 3CoreFrame
* @subpackage libraries
* @version 1.0
*/
class ThreeCore_Output_CLI {
public $screenDateEol = array('date' => TRUE, 'eol' => TRUE);
public $screenDateOnly = array('date' => TRUE, 'eol' => FALSE);
public $screenEolOnly = array('date' => FALSE, 'eol' => TRUE);
public $screenNothing = array('date' => FALSE, 'eol' => FALSE);
public function __construct() {
ob_start();
}
public function screen($message, $options = array('date' => TRUE, 'eol' => TRUE)) {
if ($options['date'] == TRUE) { echo '['.date('d/M/Y H:i:s').'] '; }
echo $message;
if ($options['eol'] == TRUE) { echo PHP_EOL; }
ob_flush();
flush();
sleep(1);
}
public function __destroy() {
ob_end_clean();
}
} //End of class
?>