Public Member Functions | |
setLogStream ($stream) | |
getLogStream () | |
log ($msg, $append_crlf=true) | |
outputData ($data, $command= '_default') | |
userConfirm () | |
clear () | |
getLog () | |
getLogText () | |
getOutput () | |
Protected Attributes | |
$_logStream = null | |
$_outStream = null | |
$_log = array() | |
$_out = array() |
Definition at line 3 of file Frontend.php.
clear | ( | ) |
getLog | ( | ) |
getLogStream | ( | ) |
getLogText | ( | ) |
Definition at line 82 of file Frontend.php.
00083 { 00084 $text = ''; 00085 foreach ($this->getLog() as $log) { 00086 $text .= $log; 00087 } 00088 return $text; 00089 }
getOutput | ( | ) |
log | ( | $ | msg, | |
$ | append_crlf = true | |||
) |
Definition at line 26 of file Frontend.php.
00027 { 00028 if (is_null($msg) || false===$msg or ''===$msg) { 00029 return; 00030 } 00031 00032 if ($append_crlf) { 00033 $msg .= "\r\n"; 00034 } 00035 00036 $this->_log[] = $msg; 00037 00038 if ('stdout'===$this->_logStream) { 00039 if ($msg==='.') { 00040 echo ' '; 00041 } 00042 echo $msg; 00043 } 00044 elseif (is_resource($this->_logStream)) { 00045 fwrite($this->_logStream, $msg); 00046 } 00047 }
outputData | ( | $ | data, | |
$ | command = '_default' | |||
) |
Definition at line 49 of file Frontend.php.
00050 { 00051 $this->_out[] = array('output'=>$data, 'command'=>$command); 00052 00053 if ('stdout'===$this->_logStream) { 00054 if (is_string($data)) { 00055 echo $data."\r\n"; 00056 } elseif (is_array($data) && !empty($data['message']) && is_string($data['message'])) { 00057 echo $data['message']."\r\n"; 00058 } elseif (is_array($data) && !empty($data['data']) && is_string($data['data'])) { 00059 echo $data['data']."\r\n"; 00060 } else { 00061 print_r($data); 00062 } 00063 } 00064 }
setLogStream | ( | $ | stream | ) |
Enter description here...
string|resource | $stream 'stdout' or open php stream |
Definition at line 15 of file Frontend.php.
userConfirm | ( | ) |
$_log = array() [protected] |
Definition at line 7 of file Frontend.php.
$_logStream = null [protected] |
Definition at line 5 of file Frontend.php.
$_out = array() [protected] |
Definition at line 8 of file Frontend.php.
$_outStream = null [protected] |
Definition at line 6 of file Frontend.php.