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-2005 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.6.2.1 2004/12/22 08:06:09 sebastian Exp $
  16. //
  17.  
  18. /**
  19.  * @author      Sebastian Bergmann <sb@sebastian-bergmann.de>
  20.  * @copyright   Copyright &copy; 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
  21.  * @license     http://www.php.net/license/3_0.txt The PHP License, Version 3.0
  22.  * @category    Testing
  23.  * @package     PHPUnit2
  24.  * @subpackage  Util
  25.  * @abstract
  26.  */
  27. abstract class PHPUnit2_Util_Printer {
  28.     // {{{ Instance Variables
  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  mixed $out 
  43.     * @access public
  44.     */
  45.     public function __construct($out = NULL{
  46.         if ($out === NULL{
  47.             $this->out fopen('php://stdout''r');
  48.         }
  49.  
  50.         else if (is_string($out)) {
  51.             $this->out fopen($out'w');
  52.         }
  53.  
  54.         else {
  55.             $this->out $out;
  56.         }
  57.     }
  58.  
  59.     // }}}
  60.     // {{{ public function __destruct()
  61.  
  62.     /**
  63.     * Destructor.
  64.     *
  65.     * @access public
  66.     */
  67.     public function __destruct({
  68.         fclose($this->out);
  69.     }
  70.  
  71.     // }}}
  72.     // {{{ public function write($buffer)
  73.  
  74.     /**
  75.     * @param  string $buffer 
  76.     * @access public
  77.     */
  78.     public function write($buffer{
  79.         fputs($this->out$buffer);
  80.     }
  81.  
  82.     // }}}
  83. }
  84.  
  85. /*
  86.  * vim600:  et sw=2 ts=2 fdm=marker
  87.  * vim<600: et sw=2 ts=2
  88.  */
  89. ?>

Documentation generated on Mon, 11 Mar 2019 14:19:18 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.