示例#1
0
 /**
  * Constructor.
  *
  * @param string $source The file path.
  * @param string $mode The access mode.
  */
 public function __construct($source, $mode)
 {
     parent::__construct();
     $this->source = $source;
     $this->mode = $mode;
     $this->resource = @fopen($source, $mode);
     $this->closed = false === $this->resource ? true : false;
 }
示例#2
0
 /**
  * Constructor.
  *
  * @param PipedInputStreamInterface $downstream The input stream to connect.
  */
 public function __construct(PipedInputStreamInterface $downstream = null)
 {
     parent::__construct();
     $this->downstream = $downstream;
     if (null !== $this->downstream) {
         // Forces downstream to connect to current stream no matter it
         // is already connected or not and allows the downstream to call
         // the ``connect()`` method of current stream to complete the
         // connection.
         $this->downstream->connect($this, true);
     }
 }
示例#3
0
 /**
  * This method creates a new string output stream.
  *
  * @param string $buffer The initial content of the internal buffer.
  */
 public function __construct($buffer = '')
 {
     parent::__construct();
     $this->buffer = $buffer;
 }