PHPUnit2
[ class tree: PHPUnit2 ] [ index: PHPUnit2 ] [ all elements ]

Source for file Printer.php

Documentation is available at Printer.php

  1. <?php
  2. //
  3. // +------------------------------------------------------------------------+
  4. // | PEAR :: PHPUnit2                                                       |
  5. // +------------------------------------------------------------------------+
  6. // | Copyright (c) 2002-2004 Sebastian Bergmann <sb@sebastian-bergmann.de>. |
  7. // +------------------------------------------------------------------------+
  8. // | This source file is subject to version 3.00 of the PHP License,        |
  9. // | that is available at http://www.php.net/license/3_0.txt.               |
  10. // | If you did not receive a copy of the PHP license and are unable to     |
  11. // | obtain it through the world-wide-web, please send a note to            |
  12. // | license@php.net so we can mail you a copy immediately.                 |
  13. // +------------------------------------------------------------------------+
  14. //
  15. // $Id: Printer.php,v 1.2 2004/04/15 15:02:37 sebastian Exp $
  16. //
  17.  
  18. /**
  19.  * @author      Sebastian Bergmann <sb@sebastian-bergmann.de>
  20.  * @copyright   Copyright &copy; 2002-2004 Sebastian Bergmann <sb@sebastian-bergmann.de>
  21.  * @license     http://www.php.net/license/3_0.txt The PHP License, Version 3.0
  22.  * @category    PHP
  23.  * @package     PHPUnit2
  24.  * @subpackage  Util
  25.  * @abstract
  26.  */
  27. abstract class PHPUnit2_Util_Printer {
  28.     // {{{ Members
  29.  
  30.     /**
  31.     * @var    resource 
  32.     * @access private
  33.     */
  34.     private $out;
  35.  
  36.     // }}}
  37.     // {{{ public function __construct($out = null)
  38.  
  39.     /**
  40.     * Constructor.
  41.     *
  42.     * @param  resource  $out 
  43.     * @access public
  44.     */
  45.     public function __construct($out = null{
  46.         if ($out === null{
  47.             $out fopen('php://stdout''r');
  48.         }
  49.  
  50.         $this->out $out;
  51.     }
  52.  
  53.     // }}}
  54.     // {{{ public function __destruct()
  55.  
  56.     /**
  57.     * Destructor.
  58.     *
  59.     * @access public
  60.     */
  61.     public function __destruct({
  62.         fclose($this->out);
  63.     }
  64.  
  65.     // }}}
  66.     // {{{ public function write($buffer)
  67.  
  68.     /**
  69.     * @param  string $buffer 
  70.     * @access public
  71.     */
  72.     public function write($buffer{
  73.         fputs($this->out$buffer);
  74.     }
  75.  
  76.     // }}}
  77. }
  78.  
  79. /*
  80.  * vim600:  et sw=2 ts=2 fdm=marker
  81.  * vim<600: et sw=2 ts=2
  82.  */
  83. ?>

Documentation generated on Mon, 11 Mar 2019 13:55:58 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.