pharext\Tempfile::closeStream PHP Method

closeStream() public method

Close the stream
public closeStream ( )
    public function closeStream()
    {
        fclose($this->handle);
    }

Usage Example

Beispiel #1
0
 /**
  * @param bool $verbose
  * @return \pharext\Task\Tempfile
  * @throws \pharext\Exception
  */
 public function run($verbose = false)
 {
     if ($verbose !== false) {
         printf("Fetching %s ...\n", $this->source);
     }
     $context = $this->createStreamContext();
     if (!($remote = fopen($this->source, "r", false, $context))) {
         throw new Exception();
     }
     $local = new Tempfile("remote");
     if (!stream_copy_to_stream($remote, $local->getStream())) {
         throw new Exception();
     }
     $local->closeStream();
     /* STREAM_NOTIFY_COMPLETED is not generated, see above */
     call_user_func($this->progress, 1);
     return $local;
 }
All Usage Examples Of pharext\Tempfile::closeStream