35+ results for 'php ftell' (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;
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);
Stream.php (https://gitlab.com/ealexis.t/trends) PHP · 245 lines
DiscISAM.php (https://gitlab.com/ptisky/API_prestashop) PHP · 219 lines
22 * @package PHPExcel_CachedObjectStorage
23 * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25 * @version 1.7.9, 2013-06-02
34 * @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
35 */
36 class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
38 /**
71 fseek($this->_fileHandle,0,SEEK_END);
72 $offset = ftell($this->_fileHandle);
73 fwrite($this->_fileHandle, serialize($this->_currentObject));
74 $this->_cellCache[$this->_currentObjectID] = array('ptr' => $offset,
85 *
86 * @param string $pCoord Coordinate address of the cell to update
87 * @param PHPExcel_Cell $cell Cell to update
88 * @return void
89 * @throws PHPExcel_Exception
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';
123 {
124 $fp = fopen($this->baz1URL, 'r');
125 $this->assertEquals(0, ftell($fp));
126 $this->assertFalse(feof($fp));
127 $this->assertEquals(0, fseek($fp, 2));
128 $this->assertEquals(2, ftell($fp));
129 $this->assertEquals(0, fseek($fp, 1, SEEK_CUR));
130 $this->assertEquals(3, ftell($fp));
File.php (https://bitbucket.org/jonbiard/nucleus.git) PHP · 233 lines
1 <?php
2 /**
3 * Class File
36 *
37 * @param string $path The file path
38 * @param string $mode The mode (see PHP's fopen() function)
39 *
40 * @throws IOException When the file path cannot be opened
72 public function getOffset()
73 {
74 if (($pos = @ftell($this->fh)) === false) {
75 throw new IOException("Failed to get pointer offset in file: $this->path");
76 }
ResumableDownload.php (https://gitlab.com/treighton/wpgit) PHP · 176 lines
1 <?php
2 /**
3 * Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
120 $this->meta = $command->execute();
122 if ($this->target->ftell() >= $this->meta['ContentLength']) {
123 return false;
124 }
131 $this->target,
132 $this->meta['ContentLength'],
133 $this->target->ftell()
134 );
147 protected function getRemaining()
148 {
149 $current = $this->target->ftell();
150 $targetByte = $this->meta['ContentLength'] - 1;
151 $this->params['Range'] = "bytes={$current}-{$targetByte}";
CallResult.php (https://github.com/WPsites/WPide.git) PHP · 226 lines
1 <?php
2 /*
3 * Copyright (C) 2011 by TEQneers GmbH & Co. KG
24 /**
25 * Git Streamwrapper for PHP
26 *
27 * @category TQ
101 // @todo is there a better way to determine if a stream contains data?
102 fseek($stdOut, 0, SEEK_END);
103 $hasStdOut = (ftell($stdOut) > 0);
104 fseek($stdOut, 0, SEEK_SET);
106 // @todo is there a better way to determine if a stream contains data?
107 fseek($stdErr, 0, SEEK_END);
108 $hasStdErr = (ftell($stdErr) > 0);
109 fseek($stdErr, 0, SEEK_SET);
Util.php (https://gitlab.com/judielsm/Handora) PHP · 285 lines
class-ai1wm-extractor.php (https://gitlab.com/haque.mdmanzurul/roadskill) PHP · 296 lines
PHPTemp.php (https://gitlab.com/techniconline/kmc) PHP · 215 lines
22 * @package PHPExcel_CachedObjectStorage
23 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25 * @version ##VERSION##, ##DATE##
29 /**
30 * PHPExcel_CachedObjectStorage_PHPTemp
31 *
32 * @category PHPExcel
34 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
35 */
36 class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache
37 {
67 $this->_cellCache[$this->_currentObjectID] = array(
68 'ptr' => ftell($this->_fileHandle),
69 'sz' => fwrite($this->_fileHandle, serialize($this->_currentObject))
70 );
Stream.php (https://github.com/livinglab/openlab.git) PHP · 270 lines
Stream.php (https://gitlab.com/reasonat/test8) PHP · 328 lines
SocketProgressBar.php (https://github.com/GunioRobot/diggin.git) PHP · 232 lines
1 <?php
3 // require_once 'Zend/Http/Client/Adapter/Socket.php';
20 private function getProgressBar()
21 {
22 if (PHP_SAPI != 'cli') throw new \RuntimeException();
24 if (!$this->_progressBar) {
25 // require_once 'Zend/ProgressBar/Adapter/Console.php';
26 // require_once 'Zend/ProgressBar.php';
92 if (! ctype_xdigit($chunksize)) {
93 $this->close();
94 // require_once 'Zend/Http/Client/Adapter/Exception.php';
95 throw new \Zend\Http\Client\Adapter\Exception('Invalid chunk size "' .
96 $chunksize . '" unable to read chunked body');
Filesystem.php (https://github.com/jarednipper/HSU-common-code.git) PHP · 223 lines
1 <?php
2 /**
3 * Zend Framework
23 /** Zend_Search_Lucene_Storage_File */
24 require_once 'Zend/Search/Lucene/Storage/File.php';
26 /** Zend_Search_Lucene_Exception */
27 require_once 'Zend/Search/Lucene/Exception.php';
53 public function __construct($filename, $mode='r+b')
54 {
55 global $php_errormsg;
57 if (strpos($mode, 'w') === false && !is_readable($filename)) {
ppi.c (https://github.com/lessandro/nbis.git) C · 173 lines
PHPTemp.php (https://gitlab.com/tonmoy1a/bitm-php-batch-26) PHP · 206 lines
22 * @package PHPExcel_CachedObjectStorage
23 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25 * @version ##VERSION##, ##DATE##
29 /**
30 * PHPExcel_CachedObjectStorage_PHPTemp
31 *
32 * @category PHPExcel
34 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
35 */
36 class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {
38 /**
65 $this->_cellCache[$this->_currentObjectID] = array(
66 'ptr' => ftell($this->_fileHandle),
67 'sz' => fwrite($this->_fileHandle, serialize($this->_currentObject))
68 );
Filesystem.php (https://github.com/ftaiolivista/Zend-Framework-Namespaced-.git) PHP · 237 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: Filesystem.php 23395 2010-11-19 15:30:47Z alexander $
21 */
29 /** Zend_Search_Lucene_Storage_File */
30 require_once 'Zend/Search/Lucene/Storage/File.php';
32 /**
55 public function __construct($filename, $mode='r+b')
56 {
57 global $php_errormsg;
59 if (strpos($mode, 'w') === false && !is_readable($filename)) {
File.php (https://github.com/alab1001101/zf2.git) PHP · 177 lines
1 <?php
2 /**
3 * Zend Framework
72 $header = '';
73 $endPos = isset($params['endPos']) ? $params['endPos'] : null;
74 while (($endPos === null || ftell($this->_fh) < $endPos) && trim($line = fgets($this->_fh))) {
75 $header .= $line;
76 }
79 Mime\Decode::splitMessage($header, $this->_headers, $body);
81 $this->_contentPos[0] = ftell($this->_fh);
82 if ($endPos !== null) {
83 $this->_contentPos[1] = $endPos;
84 } else {
85 fseek($this->_fh, 0, SEEK_END);
86 $this->_contentPos[1] = ftell($this->_fh);
87 }
88 if (!$this->isMultipart()) {
extprofile_splfile.h (https://github.com/kevlund/hiphop-php.git) C Header · 307 lines
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
6 | Copyright (c) 1997-2010 The PHP Group |
7 +----------------------------------------------------------------------+
8 | This source file is subject to version 3.01 of the PHP license, |
9 | that is bundled with this package in the file LICENSE, and is |
10 | available through the world-wide-web at the following url: |
11 | http://www.php.net/license/3_01.txt |
12 | If you did not receive a copy of the PHP license and are unable to |
13 | obtain it through the world-wide-web, please send a note to |
14 | license@php.net so we can mail you a copy immediately. |
15 +----------------------------------------------------------------------+
16 */
StreamBuffer.php (https://github.com/WPsites/WPide.git) PHP · 176 lines
main.cpp (https://github.com/cpzhang/bud.git) C++ · 213 lines
dgfirmware.c (https://gitlab.com/lede/lede-neoraider-staging) C · 377 lines
FileByteStream.php (https://gitlab.com/ealexis.t/trends) PHP · 231 lines
1 <?php
3 /*
91 ini_set('magic_quotes_runtime', 1);
92 }
93 $this->_offset = ftell($fp);
95 // If we read one byte after reaching the end of the file
193 }
194 if ($this->_seekable === false) {
195 $currentPos = ftell($this->_reader);
196 if ($currentPos < $offset) {
197 $toDiscard = $offset - $currentPos;
208 private function _copyReadStream()
209 {
210 if ($tmpFile = fopen('php://temp/maxmemory:4096', 'w+b')) {
211 /* We have opened a php:// Stream Should work without problem */
shader.cpp (https://gitlab.com/geoff-nagy/cube-instanced-rendering) C++ · 239 lines
FileProfilerStorage.php (https://github.com/Faianca/symfony.git) PHP · 223 lines
1 <?php
2 /*
3 * This file is part of the Symfony package.
192 protected function readLineFromFile($file)
193 {
194 if (ftell($file) === 0) {
195 return false;
196 }
210 $str = $char . $str;
212 if (ftell($file) === 1) {
213 // All file is read, so we move cursor to the position 0
214 fseek($file, -1, SEEK_CUR);
ext_splfile.h (https://github.com/diegoIta/hiphop-php.git) C Header · 119 lines
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010 Facebook, Inc. (http://www.facebook.com) |
6 | Copyright (c) 1997-2010 The PHP Group |
7 +----------------------------------------------------------------------+
8 | This source file is subject to version 3.01 of the PHP license, |
9 | that is bundled with this package in the file LICENSE, and is |
10 | available through the world-wide-web at the following url: |
11 | http://www.php.net/license/3_01.txt |
12 | If you did not receive a copy of the PHP license and are unable to |
100 Variant f_hphp_splfileobject_fstat(CObjRef obj);
101 int64 f_hphp_splfileobject_ftell(CObjRef obj);
102 bool f_hphp_splfileobject_ftruncate(CObjRef obj, int64 size);
file.idl.php (https://github.com/zsj888/hiphop-php.git) PHP · 325 lines
Stream.php (https://bitbucket.org/nbravo777/repo_ratchet.git) PHP · 296 lines
1 <?php
3 namespace Guzzle\Stream;
7 /**
8 * PHP stream implementation
9 */
10 class Stream implements StreamInterface
68 }
70 $originalPos = $this->ftell();
71 $body = stream_get_contents($this->stream, -1, 0);
72 $this->seek($originalPos);
95 public static function getHash(StreamInterface $stream, $algo, $rawOutput = false)
96 {
97 $pos = $stream->ftell();
98 if (!$stream->seek(0)) {
99 return false;
SafeStream.php (https://github.com/langpavel/nette.git) PHP · 309 lines
1 <?php
3 /**
191 fclose($this->tempHandle);
193 if ($this->writeError /*5.2*|| !(substr(PHP_OS, 0, 3) === 'WIN' ? unlink($this->file) : TRUE)*/
194 || !rename($this->tempFile, $this->file) // try to rename temp file
195 ) {
240 public function stream_tell()
241 {
242 return ftell($this->tempHandle);
243 }
File.php (https://github.com/Zefiryn/graduationprojects.git) PHP · 198 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: File.php 23775 2011-03-01 17:25:24Z ralph $
20 */
24 * @see Zend_Mime_Decode
25 */
26 require_once 'Zend/Mime/Decode.php';
28 /**
29 * @see Zend_Mail_Part
30 */
31 require_once 'Zend/Mail/Part.php';
pack-pbp.c (https://github.com/sidealice/pspsdk.git) C · 189 lines
Cache.php (https://github.com/livinglab/openlab.git) PHP · 262 lines
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
7 * is slow (HTTP, FTP...), but will need more IO if the file is only extracted
8 *
9 * PHP versions 4 and 5
10 *
11 * This library is free software; you can redistribute it and/or
25 * @category File Formats
26 * @package File_Archive
27 * @author Vincent Lascaux <vincentlascaux@php.net>
28 * @copyright 1997-2005 The PHP Group
29 * @license http://www.gnu.org/copyleft/lesser.html LGPL
30 * @version CVS: $Id$
31 * @link http://pear.php.net/package/File_Archive
32 */
test.c (https://github.com/UprootLabs/poly-flif.git) C · 312 lines
StreamTest.php (https://gitlab.com/ealexis.t/trends) PHP · 161 lines
1 <?php
2 namespace GuzzleHttp\Tests\Psr7;
8 * @covers GuzzleHttp\Psr7\Stream
9 */
10 class StreamTest extends \PHPUnit_Framework_TestCase
11 {
12 /**
20 public function testConstructorInitializesProperties()
21 {
22 $handle = fopen('php://temp', 'r+');
23 fwrite($handle, 'data');
24 $stream = new Stream($handle);
26 $this->assertTrue($stream->isWritable());
27 $this->assertTrue($stream->isSeekable());
28 $this->assertEquals('php://temp', $stream->getMetadata('uri'));
29 $this->assertInternalType('array', $stream->getMetadata());
30 $this->assertEquals(4, $stream->getSize());
php.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 2590 lines
11 </PROPS>
12 <RULES IGNORE_CASE="TRUE">
13 <SPAN TYPE="MARKUP" DELEGATE="PHP">
14 <BEGIN><?php</BEGIN>
16 </SPAN>
18 <SPAN TYPE="MARKUP" DELEGATE="PHP">
19 <BEGIN><?</BEGIN>
20 <END>?></END>
21 </SPAN>
23 <SPAN TYPE="MARKUP" DELEGATE="PHP">
24 <BEGIN><%=</BEGIN>
25 <END>%></END>
65 <RULES SET="TAGS" DEFAULT="MARKUP">
66 <SPAN TYPE="MARKUP" DELEGATE="PHP">
67 <BEGIN><?php</BEGIN>