Esempio n. 1
0
 /**
  * Create temporary stream
  *
  * @return resource
  */
 protected function _openTempStream()
 {
     $this->_stream_name = $this->config['output_stream'];
     if (!is_string($this->_stream_name)) {
         // If name is not given, create temp name
         $this->_stream_name = tempnam(isset($this->config['stream_tmp_dir']) ? $this->config['stream_tmp_dir'] : sys_get_temp_dir(), 'Zend_Http_Client');
     }
     if (false === ($fp = @fopen($this->_stream_name, "w+b"))) {
         if ($this->adapter instanceof Zend_Http_Client_Adapter_Interface) {
             $this->adapter->close();
         }
         require_once 'Zend/Http/Client/Exception.php';
         throw new Zend_Http_Client_Exception("Could not open temp file {$this->_stream_name}");
     }
     return $fp;
 }