15+ results for 'php fread' (0 ms)

Not the results you expected?

BodyTest.php (https://gitlab.com/leon0399/damnit-engine) PHP · 401 lines

1 <?php

2 /**

3 * Slim Framework (http://slimframework.com)

4 *

5 * @link https://github.com/slimphp/Slim

6 * @copyright Copyright (c) 2011-2015 Josh Lockhart

7 * @license https://github.com/slimphp/Slim/blob/master/LICENSE.md (MIT License)

12 use Slim\Http\Body;

13

14 class BodyTest extends \PHPUnit_Framework_TestCase

15 {

16 /**

41 public function resourceFactory($mode = 'r+')

42 {

43 $stream = fopen('php://temp', $mode);

44 fwrite($stream, $this->text);

45 rewind($stream);

execunix.c (http://hadesmem.googlecode.com/svn/trunk/) C · 0 lines ✨ Summary

This C code implements a command-line tool for executing shell commands. It manages multiple jobs (commands) and their corresponding input/output streams, handling signals, timeouts, and errors. The code uses a combination of system calls (select, waitpid) and custom functions to execute the commands, printing output and handling completion, failure, or timeout conditions.

347 char buffer[BUFSIZ];

348

349 while ( 0 < ( ret = fread( buffer, sizeof(char), BUFSIZ-1, cmdtab[ i ].stream[ s ] ) ) )

350 {

351 buffer[ret] = 0;

mail.php (https://bitbucket.org/allanxyh/uniquemall.git) PHP · 406 lines

1 <?php

2 class Mail {

3 protected $to;

94 $header .= 'Reply-To: ' . '=?UTF-8?B?' . base64_encode($this->sender) . '?=' . '<' . $this->from . '>' . $this->newline;

95 $header .= 'Return-Path: ' . $this->from . $this->newline;

96 $header .= 'X-Mailer: PHP/' . phpversion() . $this->newline;

97 //$header .= 'Content-Type: multipart/related; boundary="' . $boundary . '"' . $this->newline . $this->newline;

98 $header .= 'Content-Type: multipart/related; boundary="' . $boundary . '"' . $this->newline . $this->newline;

126 $handle = fopen($attachment, 'r');

127

128 $content = fread($handle, filesize($attachment));

129

130 fclose($handle);

157 exit();

158 } else {

159 if (substr(PHP_OS, 0, 3) != 'WIN') {

160 socket_set_timeout($handle, $this->timeout, 0);

161 }

vfsStreamWrapperFileTestCase.php (https://github.com/acoulton/vfsStream.git) PHP · 335 lines

1 <?php

2 /**

3 * Test for org::bovigo::vfs::vfsStreamWrapper.

9 require_once 'org/bovigo/vfs/vfsStream.php';

10 require_once 'PHPUnit/Framework/TestCase.php';

11 require_once dirname(__FILE__) . '/vfsStreamWrapperBaseTestCase.php';

135 $this->assertFalse(feof($fp));

136 $this->assertEquals(2, ftell($fp));

137 $this->assertEquals('z', fread($fp, 1));

138 $this->assertEquals(3, ftell($fp));

139 $this->assertEquals(' 1', fread($fp, 8092));

250 {

251 $fp = fopen($this->baz2URL, 'rb');

252 $this->assertEquals('baz2', fread($fp, 4096));

253 $this->assertEquals(0, fwrite($fp, 'foo'));

254 fclose($fp);

Openssl.php (https://github.com/Martin1982/IBMessagingWorkshopServer.git) PHP · 353 lines

1 <?php

2 /**

3 * Zend Framework

17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)

18 * @license http://framework.zend.com/license/new-bsd New BSD License

19 * @version $Id: Openssl.php 20288 2010-01-14 20:15:43Z thomas $

20 */

21

23 * @see Zend_Filter_Encrypt_Interface

24 */

25 // require_once 'Zend/Filter/Encrypt/Interface.php';

26

27 /**

69 {

70 if (!extension_loaded('openssl')) {

71 // require_once 'Zend/Filter/Exception.php';

72 throw new Zend_Filter_Exception('This filter needs the openssl extension');

73 }

mail.php (https://gitlab.com/2202Programming/navxmxp) PHP · 406 lines

1 <?php

2 class Mail {

3 protected $to;

94 $header .= 'Reply-To: ' . '=?UTF-8?B?' . base64_encode($this->sender) . '?=' . '<' . $this->from . '>' . $this->newline;

95 $header .= 'Return-Path: ' . $this->from . $this->newline;

96 $header .= 'X-Mailer: PHP/' . phpversion() . $this->newline;

97 $header .= 'Content-Type: multipart/related; boundary="' . $boundary . '"' . $this->newline . $this->newline;

98

126 $handle = fopen($attachment, 'r');

127

128 $content = fread($handle, filesize($attachment));

129

130 fclose($handle);

157 exit();

158 } else {

159 if (substr(PHP_OS, 0, 3) != 'WIN') {

160 socket_set_timeout($handle, $this->timeout, 0);

161 }

AsyncStream.php (https://github.com/Erika31/phpdaemon.git) PHP · 524 lines

1 <?php

2

3 /**

383 }

384

385 $data = fread($this->readFD, $n);

386

387 if ($data === FALSE) {

Cache_File.php (https://gitlab.com/karlen/ayo_wp) PHP · 455 lines

1 <?php

2 namespace W3TC;

3

116 $expires_at = time() + $expire;

117 @fputs( $fp, pack( 'L', $expires_at ) );

118 @fputs( $fp, '<?php exit; ?>' );

119 @fputs( $fp, @serialize( $var ) );

120 @fclose( $fp );

163 @flock( $fp, LOCK_SH );

164

165 $expires_at = @fread( $fp, 4 );

166 $data = null;

167

184

185 while ( !@feof( $fp ) ) {

186 $data .= @fread( $fp, 4096 );

187 }

188 $data = substr( $data, 14 );

handler_manager.php (https://github.com/F5/zetacomponents.git) PHP · 289 lines

1 <?php

2 /**

3 * File containing the ezcDbSchemaHandlerManager class.

45 */

46 static public $readHandlers = array(

47 'array' => 'ezcDbSchemaPhpArrayReader',

48 'mysql' => 'ezcDbSchemaMysqlReader',

49 'oracle' => 'ezcDbSchemaOracleReader',

62 */

63 static public $writeHandlers = array(

64 'array' => 'ezcDbSchemaPhpArrayWriter',

65 'mysql' => 'ezcDbSchemaMysqlWriter',

66 'oracle' => 'ezcDbSchemaOracleWriter',

79 * @var array(string=>string)

80 */

81 static public $diffReadHandlers = array(

82 'array' => 'ezcDbSchemaPhpArrayReader',

cookbook.html (https://swig.svn.sourceforge.net/svnroot/swig) HTML · 238 lines ✨ Summary

This HTML code outputs a PHP tutorial on using MagpieRSS to parse and display RSS feeds. It provides examples of how to limit the number of items returned, display custom error messages, generate new RSS feeds, filter headlines by date, and parse local files containing RSS. The content is presented in a structured format with headings, paragraphs, and code snippets.

115 <a href="http://www.php.net/ini_set">http://www.php.net/ini_set</a>, <br />

116 <a

117 href="http://www.php.net/manual/en/ref.errorfunc.php">http://www.php.net/manual/en/ref.errorfunc.php</a><br

118 />

119

172 <h3>See: </h3>

173 <a

174 href="http://www.php.net/manual/en/ref.datetime.php">http://www.php.net/manual/en/ref.datetime.php</a>

175

176 <a name="from_file"></a>

215 <h3>See: </h3>

216 <a

217 href="http://www.php.net/manual/en/ref.filesystem.php">http://www.php.net/manual/en/ref.filesystem.php</a>,<br

218 />

219 <a

PngFile.c (http://angel-engine.googlecode.com/svn/trunk/) C · 443 lines ✨ Summary

This C code provides functions for reading and writing PNG (Portable Network Graphics) files. The png_read_data function reads data from a file, while png_write_data writes data to a file. The png_flush function is used to flush the output buffer after writing data. The png_read and png_write functions are wrappers around these three functions, providing a more convenient interface for reading and writing PNG files.

126 // first check the eight byte PNG signature

127

128 fread(pbSig, 1, 8, pfFile);

129 if (png_sig_cmp(pbSig, 0, 8))

130 {

403 png_size_t check;

404

405 /* fread() returns 0 on error, so it is OK to store this in a png_size_t

406 * instead of an int, which is what fread() actually returns.

407 */

408 check = (png_size_t)fread(data, (png_size_t)1, length,

409 (FILE *)png_ptr->io_ptr);

410

decoding.html (http://angel-engine.googlecode.com/svn/trunk/) HTML · 105 lines ✨ Summary

This HTML code outputs a documentation page for libogg, a library used for decoding Ogg audio streams. The page provides an overview of the decoding process and explains how to use libogg functions such as ogg_sync_buffer and ogg_stream_packetout. It also includes links to other relevant pages and information about the copyright and release history of libogg.

23 <ul>

24 <li>Expose a buffer using <a href="ogg_sync_buffer.html">ogg_sync_buffer()</a>.

25 <li>Read data into the buffer, using fread() or a similar function.

26 <li>Call <a href="ogg_sync_wrote.html">ogg_sync_wrote()</a> to tell the synchronization layer how many bytes you wrote into the buffer.

27 <li>Write out the data using <a href="ogg_sync_pageout.html">ogg_sync_pageout</a>.

jarint.h (git://github.com/zpao/v8monkey.git) C Header · 87 lines ✨ Summary

This C header file provides a set of functions and macros for working with JAR (Java Archive) files, specifically for cryptographic operations. It includes functions for opening and closing databases, creating public key infrastructure (PKI) objects, and interacting with the Java runtime environment. The code is part of the Mozilla project and uses various libraries, including NSPR and OpenSSL.

78 #define JAR_FCLOSE PR_Close

79 #define JAR_FSEEK PR_Seek

80 #define JAR_FREAD PR_Read

81 #define JAR_FWRITE PR_Write

82

lauxlib.c (https://jetpp.svn.sourceforge.net/svnroot/jetpp) C · 654 lines ✨ Summary

This C code implements a part of the Lua programming language interpreter. It provides functions for loading files, strings, and buffers into the Lua state, as well as creating a new Lua state with an error handler. The code is written in a style consistent with the Lua C API, suggesting it’s intended to be used within the Lua project or by developers familiar with the Lua API.

536 }

537 if (feof(lf->f)) return NULL;

538 *size = fread(lf->buff, 1, LUAL_BUFFERSIZE, lf->f);

539 return (*size > 0) ? lf->buff : NULL;

540 }

TIFFReadEncodedStrip.3tiff.html (https://bitbucket.org/ultra_iter/qt-vtl.git) HTML · 133 lines

5 <meta name="generator" content="groff -Thtml, see www.gnu.org">

6 <meta name="Content-Style" content="text/css">

7 <title>TIFFReadEncodedStrip</title>

8 </head>

9 <body>

10

11 <h1 align=center>TIFFReadEncodedStrip</h1>

12 <a href="#NAME">NAME</a><br>

13 <a href="#SYNOPSIS">SYNOPSIS</a><br>

27 <td width="8%"></td>

28 <td width="91%">

29 <p><big>TIFFReadEncodedStrip &minus; read and decode a strip

30 of data from an open</big> TIFF <big>file</big></p>

31 </td>