Exemplo n.º 1
0
 /**
  * Constructs a StreamStub object.
  */
 public function __construct($file = NULL, $raw = FALSE)
 {
     if ($file && $raw) {
         $handle = fopen('php://temp', 'w+');
         fwrite($handle, $file);
         return parent::__construct($handle, strlen($file));
     }
     if (!$file) {
         $file = 'php://temp';
     }
     parent::__construct(fopen($file, 'r+'), NULL);
 }
Exemplo n.º 2
0
 public function __construct($cmd, $mode = 'r')
 {
     parent::__construct(popen($cmd, $mode));
 }