當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Stream::close方法代碼示例

本文整理匯總了PHP中Stream::close方法的典型用法代碼示例。如果您正苦於以下問題:PHP Stream::close方法的具體用法?PHP Stream::close怎麽用?PHP Stream::close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Stream的用法示例。


在下文中一共展示了Stream::close方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: close

 function close($client_id)
 {
     Stream::close($this->client_sock[$client_id]);
     $this->client_sock[$client_id] = null;
     unset($this->client_sock[$client_id]);
     $this->protocol->onClose($this, $client_id, 0);
 }
開發者ID:kilmas,項目名稱:framework,代碼行數:7,代碼來源:BlockTCP.php

示例2: close

 public function close()
 {
     if ($this->stream && is_resource($this->stream)) {
         fclose($this->stream);
     }
     parent::close();
 }
開發者ID:locphp,項目名稱:rsf,代碼行數:7,代碼來源:ResourceStream.php

示例3: get_contents

 public function get_contents()
 {
     $data = 'Test';
     $f = new Stream();
     $f->open(STREAM_MODE_WRITE);
     $f->write($data);
     $f->close();
     $this->assertEquals($data, FileUtil::getContents($f));
 }
開發者ID:Gamepay,項目名稱:xp-framework,代碼行數:9,代碼來源:FileUtilTest.class.php

示例4: archiveBytesAsStream

 /**
  * Returns 
  *
  * @return  io.Stream
  */
 protected function archiveBytesAsStream($version = -1)
 {
     static $bytes = array(1 => "CCA", 2 => "CCA");
     $s = new Stream();
     $s->open(STREAM_WRITE);
     $s->write($bytes[$version < 0 ? $this->version() : $version]);
     $s->write(str_repeat("", 248));
     // Reserved bytes
     $s->close();
     return $s;
 }
開發者ID:Gamepay,項目名稱:xp-framework,代碼行數:16,代碼來源:ArchiveTest.class.php

示例5: close

 /**
  * Closes this stream
  *
  * @return void
  */
 public function close()
 {
     $this->out->appendToken($this->out->format->close('}'));
     parent::close();
 }
開發者ID:xp-forge,項目名稱:json,代碼行數:10,代碼來源:ObjectStream.class.php

示例6: save

 /**
  * Write the stream to the given destionation directly without using extra memory like storing in an array etc.
  *
  * @param mixed $destination file path.
  */
 public function save($destination)
 {
     $dest = new Stream(is_resource($destination) ? $destination : fopen($destination, 'w+'));
     while (!$this->feof()) {
         $dest->write($this->read());
     }
     if (!is_resource($destination)) {
         // close the file if we opened it otwhise dont touch.
         $dest->close();
     }
 }
開發者ID:RituKapoor,項目名稱:php-apk-parser,代碼行數:16,代碼來源:Stream.php

示例7: close

 /**
  * 關閉某個客戶端
  * @return unknown_type
  */
 function close($client_id)
 {
     Stream::close($this->client_sock[$client_id], $this->client_event[$client_id]);
     unset($this->client_sock[$client_id], $this->client_event[$client_id]);
     $this->protocol->onClose($this, $client_id, 0);
     $this->client_num--;
 }
開發者ID:jasonshaw,項目名稱:framework-1,代碼行數:11,代碼來源:EventTCP.php

示例8: positionAfterReOpen

 public function positionAfterReOpen()
 {
     $s = new Stream();
     $s->open(STREAM_MODE_WRITE);
     $s->write('GIF89a');
     $s->close();
     $s->open(STREAM_MODE_READ);
     $this->assertEquals(0, $s->tell());
     $this->assertEquals('GIF89a', $s->read());
     $s->close();
 }
開發者ID:Gamepay,項目名稱:xp-framework,代碼行數:11,代碼來源:StreamTest.class.php

示例9: testReadline

 public function testReadline()
 {
     $stream = new Stream();
     $stream->open(STREAM_MODE_WRITE);
     $stream->writeLine('This is the first line.');
     $stream->writeLine('This is the second line.');
     $stream->writeLine('And there is a third one.');
     $stream->close();
     $stream->open(STREAM_MODE_READ);
     $this->s = new EncapsedStream($stream, 5, $stream->size() - 35);
     $this->assertEquals('is the first line.', $this->s->readLine());
     $this->assertEquals('This is the second li', $this->s->readLine());
     $this->assertEquals('', $this->s->readLine());
 }
開發者ID:Gamepay,項目名稱:xp-framework,代碼行數:14,代碼來源:EncapsedStreamTest.class.php


注:本文中的Stream::close方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。