Varien_Pear_Frontend Class Reference

List of all members.

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()


Detailed Description

Definition at line 3 of file Frontend.php.


Member Function Documentation

clear (  ) 

Definition at line 71 of file Frontend.php.

00072     {
00073         $this->_log = array();
00074         $this->_out = array();
00075     }

getLog (  ) 

Definition at line 77 of file Frontend.php.

00078     {
00079         return $this->_log;
00080     }

getLogStream (  ) 

Definition at line 21 of file Frontend.php.

00022     {
00023         return $this->_logStream;
00024     }

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 (  ) 

Definition at line 91 of file Frontend.php.

00092     {
00093         return $this->_out;
00094     }

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...

Parameters:
string|resource $stream 'stdout' or open php stream

Definition at line 15 of file Frontend.php.

00016     {
00017         $this->_logStream = $stream;
00018         return $this;
00019     }

userConfirm (  ) 

Definition at line 66 of file Frontend.php.

00067     {
00068 
00069     }


Member Data Documentation

$_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.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:25:04 2009 for Magento by  doxygen 1.5.8