openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

Write.class.php (400B)


      1 <?php
      2 
      3 namespace dsl\standard;
      4 
      5 class Write
      6 {
      7 	public $buffer;
      8 
      9 	public function __invoke( $text )
     10 	{
     11 		if   ( is_object($text ) && !method_exists($text, '__toString') )
     12 			// Workaround for external objects, that do not implement __toString()
     13 			$this->buffer .= get_class($text);
     14 		elseif   ( is_array($text)  )
     15 			$this->buffer .= '['.implode(',',$text).']';
     16 		else
     17 			$this->buffer .= $text;
     18 	}
     19 }