100+ results for 'php fopen'

Not the results you expected?

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;

124 foreach ($this->attachments as $attachment) {

125 if (file_exists($attachment)) {

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

127

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

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

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

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

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

122 public function usingFilePointer()

123 {

124 $fp = fopen($this->baz1URL, 'r');

125 $this->assertEquals(0, ftell($fp));

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

208 $vfsFile = vfsStream::url('foo/overwrite.txt');

209 file_put_contents($vfsFile, 'test');

210 $this->assertFalse(@fopen($vfsFile, 'xb'));

211 $this->assertEquals('test', file_get_contents($vfsFile));

212 }

239 public function canNotOpenWithIllegalMode()

240 {

241 $this->assertFalse(@fopen($this->baz2URL, 'invalid'));

242 }

243

test.php (https://github.com/F5/zetacomponents.git) PHP · 297 lines

1 <?php

2 /**

3 *

148 $tempDir = $this->createTempDir( get_class( $this ) );

149 $path = $tempDir . DIRECTORY_SEPARATOR . $value;

150 $fh = fopen( $path, "wb" );

151 fwrite( $fh, "some values" );

152 fclose( $fh );

183 $tempDir = $this->createTempDir( get_class( $this ) );

184 $path = $tempDir . DIRECTORY_SEPARATOR . $value;

185 $fh = fopen( $path, "wb" );

186 fwrite( $fh, "some values" );

187 fclose( $fh );

DtoTest.php (https://gitlab.com/cezar.zaleski/commonsphp) PHP · 328 lines

1 <?php

2

3 namespace CommonsTest\Pattern\Dto;

4

5 // Necessário para simular o DtoInvalido com namespace Commons/Dto

6 require_once __DIR__ . '/Mock/Escola.php';

7 require_once __DIR__ . '/Mock/Aluno.php';

8 require_once __DIR__ . '/Mock/Matricula.php';

9

10 use CommonsTest\Pattern\Dto\Mock\EmailVazio;

53 return array(

54 array(

55 fopen(__DIR__ . '/DtoTest.php', 'r')

56 ),

57 array(

ext_zlib.php (https://github.com/tstarling/hiphop-php.git) PHP · 376 lines

1 <?hh

2 // @generated by docskel.php

3

4 /**

61 * library.

62 * @param int $encoding_mode - The encoding mode. Can be FORCE_GZIP (the

63 * default) or FORCE_DEFLATE. Prior to PHP 5.4.0, using FORCE_DEFLATE

64 * results in a standard zlib deflated string (inclusive zlib headers)

65 * after a gzip file header but without the trailing crc32 checksum. In

66 * PHP 5.4.0 and later, FORCE_DEFLATE generates RFC 1950 compliant

67 * output, consisting of a zlib header, the deflated data, and an Adler

68 * checksum.

161 *

162 * @param string $filename - The file name.

163 * @param string $mode - As in fopen() (rb or wb) but can also include a

164 * compression level (wb9) or a strategy: f for filtered data as in wb6f,

165 * h for Huffman only compression as in wb1h. (See the description of

FileValidatorTest.php (https://github.com/Exercise/symfony.git) PHP · 324 lines

1 <?php

2

3 /*

17 use Symfony\Component\HttpFoundation\File\UploadedFile;

18

19 abstract class FileValidatorTest extends \PHPUnit_Framework_TestCase

20 {

21 protected $context;

34 $this->validator->initialize($this->context);

35 $this->path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'FileValidatorTest';

36 $this->file = fopen($this->path, 'w');

37 }

38

RedirectPluginTest.php (https://gitlab.com/techniconline/kmc) PHP · 277 lines

1 <?php

2

3 namespace Guzzle\Tests\Plugin\Redirect;

188 $request = $client->put();

189 $request->configureRedirects(true);

190 $body = EntityBody::factory(fopen($this->getServer()->getUrl(), 'r'));

191 $body->read(1);

192 $request->setBody($body)->send();

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

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

42 {

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

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

45 rewind($stream);

241 public function isReadableAttachedFalse()

242 {

243 $stream = fopen('php://temp', 'w');

244 $body = new Body($this->stream);

245

267 public function isWritableAttachedFalse()

268 {

269 $stream = fopen('php://temp', 'r');

270 $body = new Body($this->stream);

271

plugins.php (https://github.com/sarriaroman/Cronos-Aion.git) PHP · 389 lines

1 <?php

2

3 /**

54 */

55 function create_database_schema_from_file($file) {

56 $fh = fopen($file, 'r');

57 $sql = fread($fh, filesize($file));

58 fclose($fh);

178 $plg = Plugin::getByPath($plugin);

179

180 return urlencode( base_url . 'admin.php?plugin=' . $plg->invoke_name . '&section=' . $section );

181 } else {

182 $permalink = getPermalink(0);

204 $plg = Plugin::getByPath($plugin);

205

206 return urlencode( base_url . 'admin.php?plugin=' . $plg->invoke_name . '&section=' . $section . "&module=" . $module );

207 } else {

208 $permalink = getPermalink(0);

dir_hash.c (https://gitlab.com/infraredbg/android_system_core-mt6589) C · 335 lines

68 } else if (S_ISREG(sb.st_mode)) {

69 char buf[10000];

70 FILE *f = fopen(path, "rb");

71 int len;

72

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

1 <?php

2

3 /**

98 elseif ($u['scheme'] === 'file') {

99 $this->filePath = substr($url, 7);

100 $readFD = @fopen($this->filePath, 'r');

101 $this->fileMode = TRUE;

102 }

test.php (https://github.com/xmak/ezComponents.git) PHP · 301 lines

1 <?php

2 /**

3 * @copyright Copyright (C) 2005-2010 eZ Systems AS. All rights reserved.

152 $tempDir = $this->createTempDir( get_class( $this ) );

153 $path = $tempDir . DIRECTORY_SEPARATOR . $value;

154 $fh = fopen( $path, "wb" );

155 fwrite( $fh, "some values" );

156 fclose( $fh );

187 $tempDir = $this->createTempDir( get_class( $this ) );

188 $path = $tempDir . DIRECTORY_SEPARATOR . $value;

189 $fh = fopen( $path, "wb" );

190 fwrite( $fh, "some values" );

191 fclose( $fh );

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 */

22

28

29 /** Zend_Search_Lucene_Storage_File */

30 require_once 'Zend/Search/Lucene/Storage/File.php';

31

32 /**

55 public function __construct($filename, $mode='r+b')

56 {

57 global $php_errormsg;

58

59 if (strpos($mode, 'w') === false && !is_readable($filename)) {

FileTest.class.php (https://github.com/treuter/xp-framework.git) PHP · 361 lines

248 #[@test]

249 public function stderr() {

250 $this->assertEquals('php://stderr', create(new File('php://stderr'))->getURI());

251 }

252

257 #[@test]

258 public function stdout() {

259 $this->assertEquals('php://stdout', create(new File('php://stdout'))->getURI());

260 }

261

266 #[@test]

267 public function stdin() {

268 $this->assertEquals('php://stdin', create(new File('php://stdin'))->getURI());

269 }

270

plugin.php (https://github.com/StandbyTaskForce/Ushahidi_Web.git) PHP · 292 lines

1 <?php

2 /**

3 * Plugins helper

158 if ( file::file_exists_i($file) )

159 {

160 $fp = fopen( $file, 'r' );

161

162 // Pull only the first 8kiB of the file in.

196 {

197 // Determine if readme.txt (Case Insensitive) exists

198 $file = PLUGINPATH.$plugin."/controllers/admin/".$plugin."_settings.php";

199 if ( file::file_exists_i($file) )

200 {

271 $configuration = array();

272

273 $file = PLUGINPATH.$name.'/config/'.$name.'.php';

274 if ( file_exists($file) )

275 {

Filesystem.php (https://github.com/nigeldaley/moodle.git) PHP · 222 lines

1 <?php

2 /**

3 * Zend Framework

22

23 /** Zend_Search_Lucene_Storage_File */

24 require_once 'Zend/Search/Lucene/Storage/File.php';

25

26 /** Zend_Search_Lucene_Exception */

27 require_once 'Zend/Search/Lucene/Exception.php';

28

29

53 public function __construct($filename, $mode='r+b')

54 {

55 global $php_errormsg;

56

57 if (strpos($mode, 'w') === false && !is_readable($filename)) {

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 }

SplFileInfo.php (https://github.com/tstarling/hiphop-php.git) PHP · 432 lines

3 // This doc comment block generated by idl/sysdoc.php

4 /**

5 * ( excerpt from http://php.net/manual/en/class.splfileinfo.php )

6 *

7 * The SplFileInfo class offers a high-level object oriented interface to

229 // This doc comment block generated by idl/sysdoc.php

230 /**

231 * ( excerpt from http://php.net/manual/en/splfileinfo.getextension.php )

232 *

233 * Retrieves the file extension.

292 // This doc comment block generated by idl/sysdoc.php

293 /**

294 * ( excerpt from http://php.net/manual/en/splfileinfo.isdir.php )

295 *

296 * This method can be used to determine if the file is a directory.

CSV.php (https://github.com/damanlovett/FTEP.git) PHP · 299 lines

33 * @package PHPExcel_Writer

34 * @copyright Copyright (c) 2006 - 2010 PHPExcel (http://www.codeplex.com/PHPExcel)

35 */

36 class PHPExcel_Writer_CSV implements PHPExcel_Writer_IWriter {

87 * Create a new PHPExcel_Writer_CSV

88 *

89 * @param PHPExcel $phpExcel PHPExcel object

90 */

91 public function __construct(PHPExcel $phpExcel) {

92 $this->_phpExcel = $phpExcel;

93 $this->_delimiter = ',';

94 $this->_enclosure = '"';

109 $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();

110 PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);

111

112 // Open file

DirectFilesystem.php (https://github.com/ChuguluGames/mediawiki-svn.git) PHP · 500 lines

1 <?php

2

3 /**

4 * File holding the DirectFilesystem class.

5 *

6 * @file DirectFilesystem.php

7 * @ingroup Deployment

8 * @ingroup Filesystem

16

17 /**

18 * Filesystem class for direct PHP file and folder manipulation.

19 *

20 * @author Jeroen De Dauw

481 public function writeToFile( $file, $contents, $mode = false ) {

482 wfSuppressWarnings();

483 $fopen = fopen( $file, 'w' );

484 wfRestoreWarnings();

485

ReportGrid.php (https://github.com/germc/client-libraries.git) PHP · 325 lines

1 <?php

2 /**

3 * Provides access to the Report Grid API platform.

264

265 $stream_context = stream_context_create($http_params);

266 $file_pointer = fopen($json_endpoint, 'rb', false, $stream_context);

267

268 if (!$file_pointer) {

files.php (https://gitlab.com/webbroteam/satisfaction-mvc) PHP · 306 lines

13 */

14

15 namespace phpFastCache\Drivers;

16

17 use phpFastCache\Core\DriverAbstract;

18 use phpFastCache\Exceptions\phpFastCacheDriverException;

19

20 /**

28 * phpFastCache_files constructor.

29 * @param array $config

30 * @throws phpFastCacheDriverException

31 */

32 public function __construct($config = array())

57 * @param bool $skip

58 * @return string

59 * @throws phpFastCacheDriverException

60 */

61 private function getFilePath($keyword, $skip = false)

File.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 166 lines

1 <?php

2 /**

3 * Zend Framework

25 * @see Zend_Auth_Adapter_Http_Resolver_Interface

26 */

27 #require_once 'Zend/Auth/Adapter/Http/Resolver/Interface.php';

28

29

71 * @see Zend_Auth_Adapter_Http_Resolver_Exception

72 */

73 #require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php';

74 throw new Zend_Auth_Adapter_Http_Resolver_Exception('Path not readable: ' . $path);

75 }

116 * @see Zend_Auth_Adapter_Http_Resolver_Exception

117 */

118 #require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php';

119 throw new Zend_Auth_Adapter_Http_Resolver_Exception('Username is required');

120 } else if (!ctype_print($username) || strpos($username, ':') !== false) {

bloxx_rssdisplay.php (https://github.com/telmomenezes/bloxx.git) PHP · 158 lines

1 <?php

2 // Bloxx - Open Source Content Management System

3 //

20 // Authors: Telmo Menezes <telmo@cognitiva.net>

21 //

22 // $Id: bloxx_rssdisplay.php,v 1.6 2005-08-08 16:38:35 tmenezes Exp $

23

24 require_once 'defines.php';

25 require_once(CORE_DIR.'bloxx_module.php');

26

27 class Bloxx_RssDisplay extends Bloxx_Module

75 xml_set_character_data_handler($parser, "cdata");

76

77 if(!($fp = fopen("http://www.wired.com/news/feeds/rss2/0,2610,3,00.xml", "r"))){

78

79 //could not open XML input

File.php (https://github.com/vadimonus/moodle.git) PHP · 166 lines

1 <?php

2 /**

3 * Zend Framework

25 * @see Zend_Auth_Adapter_Http_Resolver_Interface

26 */

27 require_once 'Zend/Auth/Adapter/Http/Resolver/Interface.php';

28

29

71 * @see Zend_Auth_Adapter_Http_Resolver_Exception

72 */

73 require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php';

74 throw new Zend_Auth_Adapter_Http_Resolver_Exception('Path not readable: ' . $path);

75 }

116 * @see Zend_Auth_Adapter_Http_Resolver_Exception

117 */

118 require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php';

119 throw new Zend_Auth_Adapter_Http_Resolver_Exception('Username is required');

120 } else if (!ctype_print($username) || strpos($username, ':') !== false) {

smarty_internal_data.php (https://gitlab.com/mike_tm555/batiste) PHP · 404 lines

1 <?php

2 /**

3 * Smarty Internal Plugin Data

386 {

387 $_result = '';

388 $fp = fopen($variable, 'r+');

389 if ($fp) {

390 while (!feof($fp) && ($current_line = fgets($fp)) !== false) {

class_writer.php (https://github.com/F5/zetacomponents.git) PHP · 290 lines

1 <?php

2 /**

3 * File containing the ezcDbSchemaPersistentClassWriter class.

26

27 /**

28 * This handler creates PHP classes to be used with PersistentObject from a

29 * DatabaseSchema.

30 *

175

176 /**

177 * Writes a PHP class.

178 * This method writes a PHP class from a table definition.

209 * Open a file for writing a PersistentObject definition to.

210 * This method opens a file for writing a PersistentObject definition to

211 * and writes the basic PHP open tag to it.

212 *

213 * @param string $dir The diretory to open the file in.

test_main.cpp (https://github.com/blackberry/BB10-WebWorks-Framework.git) C++ · 248 lines

23 int createTestFile(const char *filePath)

24 {

25 FILE *new_file = fopen(filePath, "w");

26

27 if (!new_file) {

39

40 std::string source_file = "/accounts/1000/shared/camera/abcdefg.hij";

41 std::string target_url = "http://bojap.com/omg/uploader.php";

42

43 std::string source_escaped(curl_easy_escape(curl, curl_easy_escape(curl, source_file.c_str(), 0), 0));

65

66 std::string source_file = "/accounts/1000/shared/documents/filetransfer_test.txt";

67 std::string target_url = "http://www.google.com/uploader.php";

68

69 std::string source_escaped(curl_easy_escape(curl, curl_easy_escape(curl, source_file.c_str(), 0), 0));

Reports.php (https://gitlab.com/dmsapiens/physicians) PHP · 327 lines

1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

2

3 class Reports extends CI_Controller {

308 header( 'Content-Type: text/csv;charset=utf-8' );

309 header( 'Content-Disposition: attachment;filename=report'.$filename);

310 $fp = fopen('php://output', 'w');

311

312 foreach($result as $row)

Gettext.php (https://bitbucket.org/DragonBe/zfform.git) PHP · 169 lines

1 <?php

2 /**

3 * Zend Framework

21

22 /** Zend_Locale */

23 require_once 'Zend/Locale.php';

24

25 /** Zend_Translate_Adapter */

26 require_once 'Zend/Translate/Adapter.php';

27

28 /**

67 $this->_data = array();

68 $this->_bigEndian = false;

69 $this->_file = @fopen($filename, 'rb');

70 if (!$this->_file) {

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

Local.php (https://gitlab.com/Ofcadavidm/RentCarApp) PHP · 420 lines

1 <?php

2

3 namespace League\Flysystem\Adapter;

113 $location = $this->applyPathPrefix($path);

114 $this->ensureDirectory(dirname($location));

115 $stream = fopen($location, 'w+');

116

117 if (! $stream) {

138 {

139 $location = $this->applyPathPrefix($path);

140 $stream = fopen($location, 'r');

141

142 return compact('stream', 'path');

test.c (https://github.com/nchaimov/m3l-af.git) C · 484 lines

419

420 {

421 FILE *f = fopen ("test.txt", "w");

422 gsl_histogram_fprintf (f, h, "%.19g", "%.19g");

423 fclose (f);

425

426 {

427 FILE *f = fopen ("test.txt", "r");

428 gsl_histogram *hh = gsl_histogram_calloc (N);

429 int status = 0;

448

449 {

450 FILE *f = fopen ("test.dat", "wb");

451 gsl_histogram_fwrite (f, h);

452 fclose (f);

Node.php (https://gitlab.com/wuhang2003/rainloop-webmail) PHP · 214 lines

1 <?php

2

3 namespace SabreForRainLoop\DAV\FSExt;

92

93 // opening up the file, and creating a shared lock

94 $handle = fopen($path,'r');

95 flock($handle,LOCK_SH);

96 $data = '';

127

128 // opening up the file, and creating a shared lock

129 $handle = fopen($path,'a+');

130 flock($handle,LOCK_EX);

131 $data = '';

183

184 // opening up the file, and creating a shared lock

185 $handle = fopen($path,'a+');

186 flock($handle,LOCK_EX);

187 $data = '';

mbox_transport.php (https://github.com/F5/zetacomponents.git) PHP · 211 lines

1 <?php

2 /**

3 * File containing the ezcMailMboxTransport class

65 throw new ezcBaseFilePermissionException( $fileName, ezcBaseFileException::READ );

66 }

67 $this->fh = fopen( $fileName, 'rt' );

68 }

69

vision_utilities.c (https://github.com/kscottz/ClassCrap.git) C · 486 lines

113

114 /* open it */

115 if (!fname || (input=fopen(fname,"rb"))==0)

116 return-1;

117

170

171 /* open it */

172 if (!fname || (input=fopen(fname,"rb"))==0)

173 return-1;

174

239

240 /* open the file */

241 if (!fname || (output=fopen(fname,"wb"))==0)

242 return(-1);

243

index.php (https://github.com/echiu64/Bitcoin-mining-proxy.git) PHP · 307 lines

1 <?php

2

3 /*

4 * ./htdocs/admin/index.php

5 *

6 * Copyright (C) 2011 Chris Howie <me@chrishowie.com>

20 */

21

22 require_once(dirname(__FILE__) . '/../common.inc.php');

23 require_once(dirname(__FILE__) . '/../admin/controller.inc.php');

24 require_once(dirname(__FILE__) . '/../views/admin/dashboard.view.php');

25

26 class AdminDashboardController extends AdminController

share.php (https://gitlab.com/AaronDeb/cloudbox) PHP · 190 lines

1 <?PHP

2 include 'init.php';

53 $actFileNameResult = dbUtil::SELECT("SELECT clmnActFN FROM tblFiles WHERE clmnFileId=:fileid", array(':fileid' => $fileId));

54 $actFileName = $actFileNameResult[0]['clmnActFN'];

55 $fh = fopen("../files/" . $actFileName,'r');

56 $fileArray = null;

57 $i = 0;

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 {

37

38 /**

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

90 */

91 public function addCacheData($pCoord, PHPExcel_Cell $cell) {

92 if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {

93 $this->_storeData();

Process.php (https://gitlab.com/yasminmostfa/thomas-site) PHP · 257 lines

1 <?php

2 /**

3 * Piwik - free/libre analytics platform

194

195 if (empty($uname)) {

196 $uname = php_uname();

197 }

198

232 private static function isProcFSMounted()

233 {

234 if (is_resource(@fopen('/proc', 'r'))) {

235 return true;

236 }

237 // Testing if /proc is a resource with @fopen fails on systems with open_basedir set.

238 // by using stat we not only test the existence of /proc but also confirm it's a 'proc' filesystem

239 $type = @shell_exec('stat -f -c "%T" /proc 2>/dev/null');

Storage.php (https://gitlab.com/fiesta-framework/Documentation) PHP · 382 lines

1 <?php

2

3 /**

65 protected function putNonStatic($name,$content)

66 {

67 $myfile = fopen($this->storagePath."/".$name, "w");

68 fwrite($myfile, $content);

69 fclose($myfile);

73 {

74 $self=new self();

75 $myfile = fopen($self->storagePath."/".$name, "w");

76 fwrite($myfile, $content);

77 fclose($myfile);

cache.php (https://github.com/bitweaver/commerce.git) PHP · 158 lines

1 <?php

2 //

3 // +----------------------------------------------------------------------+

6 // | Copyright (c) 2003 The zen-cart developers |

7 // | |

8 // | http://www.zen-cart.com/index.php |

9 // | |

10 // | Portions Copyright (c) 2003 osCommerce |

34

35 // try to open the file

36 if ($fp = @fopen($filename, 'w')) {

37 // obtain a file lock to stop corruptions occuring

38 flock($fp, 2); // LOCK_EX

69

70 // try to open file

71 if ($fp = @fopen($filename, 'r')) {

72 // read in serialized data

73 $szdata = fread($fp, filesize($filename));

file.php (https://github.com/enygma/fuel.git) PHP · 274 lines

1 <?php

2 /**

3 * Fuel

4 *

5 * Fuel is a fast, lightweight, community driven PHP5 framework.

6 *

7 * @package Fuel

10 * @license MIT License

11 * @copyright 2010 Dan Horrigan

12 * @link http://fuelphp.com

13 */

14

210 // write the cache

211 $file = static::$path.$id_path.'.cache';

212 $handle = fopen($file, 'c');

213

214 if ($handle)

log.php (https://gitlab.com/VTTE/sitios-vtte) PHP · 388 lines

1 <?php

2

3 class RE_Log {

109 header( 'Content-Disposition: attachment; filename="' . $filename . '"' );

110

111 $stdout = fopen( 'php://output', 'w' );

112

113 fputcsv( $stdout, array( 'date', 'source', 'target', 'ip', 'referrer', 'agent' ) );

240 header( 'Content-Disposition: attachment; filename="' . $filename . '"' );

241

242 $stdout = fopen( 'php://output', 'w' );

243

244 fputcsv( $stdout, array( 'date', 'source', 'ip', 'referrer', 'useragent' ) );

make_lts_wfst.scm (https://github.com/jackieju/irobot_app.git) Scheme · 156 lines

138

139 (define (savergtree tree fname)

140 (let ((fd (fopen fname "w")))

141 ; (format fd "(RegularGrammar\n")

142 ; (format fd " name\n")

ConfigParser.inc.php (https://github.com/ojsde/pkp-lib.git) PHP · 217 lines

1 <?php

2

3 /**

4 * @file classes/config/ConfigParser.inc.php

5 *

6 * Copyright (c) 2000-2012 John Willinsky

10 * @ingroup config

11 *

12 * @brief Class for parsing and modifying php.ini style configuration files.

13 */

14

27 /**

28 * Read a configuration file into a multidimensional array.

29 * This is a replacement for the PHP parse_ini_file function, which does not type setting values.

30 * @param $file string full path to the config file

31 * @return array the configuration data (same format as http://php.net/parse_ini_file)

File.php (https://bitbucket.org/tschrock52/ethodeshare.git) PHP · 274 lines

1 <?php

2 /**

3 * Magento

8 * that is bundled with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://opensource.org/licenses/osl-3.0.php

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

22 * @package Mage_Archive

23 * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)

24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

25 */

26

185 protected function _open($mode)

186 {

187 $this->_fileHandler = @fopen($this->_filePath, $mode);

188

189 if (false === $this->_fileHandler) {

index.php (https://github.com/thomascrepain/classCreator.git) PHP · 217 lines

1 <?php

2

3 require_once 'settings.php';

4 require_once 'dal/MySQLDatabase.php';

5 require_once 'libs/Smarty.class.php';

107

108 // save to new file

109 $file = fopen($generatedFile, 'w') or die("Couldn't create file: " . toCamelCase($table));

110 fwrite($file, $fileContent);

111 fclose($file);

142 // Boolean

143 if (preg_match('/bool/i', $SQLtype) || preg_match('/boolean/i', $SQLtype)) {

144 $types = array('php' => 'boolean', 'as' => 'Boolean');

145 }

146

FileSystem_LocalTest.php (https://github.com/ThiloWitt/core.git) PHP · 311 lines

1 <?php

2 require_once dirname(__FILE__) . '/../../../../bootstrap.php';

3

4 // exclude the following file from code coverage reports.

5 PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(dirname(__FILE__). '/../../../../../src/lib/Zikula/FileSystem/Facade/Local.php');

6

7 /**

8 * Zikula_FileSystem_Local test case.

9 */

10 class Zikula_FileSystem_LocalTest extends PHPUnit_Framework_TestCase

11 {

12

141 {

142 // Configure the stub.

143 $handle = fopen('php://temp', 'r+');

144 $stub = $this->getMock('Zikula_FileSystem_Facade_Local');

145 $stub->expects($this->any())

PoFileParser.php (https://github.com/LubosRemplik/cakephp.git) PHP · 184 lines

1 <?php

2 /**

3 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)

4 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

5 *

9 *

10 * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

11 * @link https://cakephp.org CakePHP(tm) Project

12 * @since 3.0.0

13 * @license https://opensource.org/licenses/mit-license.php MIT License

72 public function parse($resource)

73 {

74 $stream = fopen($resource, 'rb');

75

76 $defaults = [

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

124 foreach ($this->attachments as $attachment) {

125 if (file_exists($attachment)) {

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

127

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

157 exit();

158 } else {

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

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

161 }

AbstractDumper.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 222 lines

1 <?php

2

3 /*

22 abstract class AbstractDumper implements DataDumperInterface, DumperInterface

23 {

24 public static $defaultOutput = 'php://output';

25

26 protected $line = '';

39 public function __construct($output = null, $charset = null)

40 {

41 $this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');

42 $this->decimalPoint = (string) 0.5;

43 $this->decimalPoint = $this->decimalPoint[1];

64 } else {

65 if (is_string($output)) {

66 $output = fopen($output, 'wb');

67 }

68 $this->outputStream = $output;

Error.php (https://bitbucket.org/vaneves/repono.git) PHP · 220 lines

1 <?php

2 /*

3 * Copyright (c) 2012, Valdirene da Cruz Neves Júnior <vaneves@vaneves.com>

15 {

16 /**

17 * Método que é executado quando ocorre algum erro no PHP

18 * @param int $type tipo do erro, que pode ser E_STRICT

19 * @param sintrg $message mensagem do erro

64

65 /**

66 * Método executado quando ocorre algum erro fatal no PHP, esse método é chamado

67 * antes que o PHP pare a execução da página

96 {

97 if (Debug::enabled())

98 return require_once root . 'core/error/debug.php';

99

100 $files = array();

system.php (https://github.com/transitiv/ninja.git) PHP · 227 lines

1 <?php defined('SYSPATH') OR die('No direct access allowed.');

2

3 /**

147 }

148

149 $fh = fopen($file, "r");

150 if (!$fh)

151 return false;

CMakeLists.txt (https://github.com/lus5d/cwcore.git) CMake · 304 lines

186 OutdoorPvPEP.cpp

187 OutdoorPvPEP.h

188 OutdoorPvPHP.cpp

189 OutdoorPvPHP.h

300 ZoneScript.h

301 )

302 add_definitions(-fopenmp)

303 add_library(game STATIC ${game_STAT_SRCS})

304 ADD_DEPENDENCIES(game revision_nr.h)

Privilege.php (https://bitbucket.org/khuongduybui/openfisma.git) PHP · 191 lines

1 <?php

2 /**

3 * Copyright (c) 2013 Endeavor Systems, Inc.

161 $builtinRoles

162 );

163 $fh = fopen(dirname(__FILE__) . '/builtin-roles.csv', 'r');

164 while ($row = fgetcsv($fh)) {

165 $this->getHelper()->exec(

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.

50 * @param string|resource|EntityBodyInterface $target Where the object should be downloaded to. Pass a string to

51 * save the object to a file, pass a resource returned by

52 * fopen() to save the object to a stream resource, or pass a

53 * Guzzle EntityBody object to save the contents to an

54 * EntityBody.

67 // If a string is passed, then assume that the download should stream to a file on disk

68 if (is_string($target)) {

69 if (!($target = fopen($target, 'a+'))) {

70 throw new RuntimeException("Unable to open {$target} for writing");

71 }

File.php (https://github.com/speedupmate/Magento-CE-Mirror.git) PHP · 274 lines

1 <?php

2 /**

3 * Magento

8 * that is bundled with this package in the file LICENSE.txt.

9 * It is also available through the world-wide-web at this URL:

10 * http://opensource.org/licenses/osl-3.0.php

11 * If you did not receive a copy of the license and are unable to

12 * obtain it through the world-wide-web, please send an email

22 * @package Mage_Archive

23 * @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)

24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)

25 */

26

185 protected function _open($mode)

186 {

187 $this->_fileHandler = @fopen($this->_filePath, $mode);

188

189 if (false === $this->_fileHandler) {

eva_geometrie_administrations.php (https://bitbucket.org/pombredanne/spip-zone-treemap.git) PHP · 160 lines

28 }

29 //Ajout de l'icone pour le format tst pour Scilab

30 if (!@fopen(_DIR_IMG."icones/tst.png", "r")) {copy(_DIR_PLUGIN_EVA_GEOMETRIE.'img_pack/tst.png',_DIR_IMG.'icones/tst.png');}

31 //On poursuit avec l'ajout du format tst dans la base de données

32 $test_tst_req=sql_select('inclus','spip_types_documents',"extension = 'tst'");

74 }

75 //On commence par ajouter l'icone pour le format xws = logiciel Xcas

76 if (!@fopen(_DIR_IMG."icones/xws.png", "r")) {copy(_DIR_PLUGIN_EVA_GEOMETRIE.'img_pack/xws.png',_DIR_IMG.'icones/xws.png');}

77 //On poursuit avec l'ajout du format xws dans la base de données

78 $test_xws_req=sql_select('inclus','spip_types_documents',"extension = 'xws'");

108 $test5_ta=sql_fetch($test5_req);

109 $test5=$test5_ta['inclus'];

110 if ((!@opendir(_DIR_IMG."icones")) OR (!@fopen(_DIR_IMG."icones/ggb.png", "r")) OR (!@fopen(_DIR_IMG."icones/glb.png", "r")) OR (!@fopen(_DIR_IMG."icones/gxt.png", "r")) OR (!@fopen(_DIR_IMG."icones/zir.png", "r")) OR (!@fopen(_DIR_IMG."icones/zirs.png", "r")) OR !$test OR !$test2 OR !$test3 OR !$test4 OR !$test5) {return false;}

111 else {return true;}

112 }

115 case 'install':

116 if (!@opendir(_DIR_IMG."icones")) {mkdir(_DIR_IMG."icones");}

117 if (!@fopen(_DIR_IMG."icones/ggb.png", "r")) {copy(_DIR_PLUGIN_EVA_GEOMETRIE.'img_pack/ggb.png',_DIR_IMG.'icones/ggb.png');}

118 if (!@fopen(_DIR_IMG."icones/glb.png", "r")) {copy(_DIR_PLUGIN_EVA_GEOMETRIE.'img_pack/glb.png',_DIR_IMG.'icones/glb.png');}

index.php (https://bitbucket.org/jose_everson2013/wally-consultoria.git) PHP · 207 lines

1 <?php

2 ini_set("allow_url_fopen", true);

82 * --------------------------------------------------------------------

83 *

84 * Normally you will set your default controller in the routes.php file.

85 * You can, however, force a custom routing by hard-coding a

86 * specific controller class/function here. For most applications, you

115 * The $assign_to_config array below will be passed dynamically to the

116 * config class when initialized. This allows you to set custom config

117 * items or override any default config values found in the config.php file.

118 * This can be handy as it permits you to share one application between

119 * multiple front controller files, with each file containing different

165 define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));

166

167 // The PHP file extension

168 // this global constant is deprecated.

169 define('EXT', '.php');

backup.php (https://bitbucket.org/pastor399/newcastleunifc.git) PHP · 123 lines

1 <?php

2 /**

3 * @version $Id$

39 $existedTables = $dbo->getTableList();

40

41 $fileHandle = fopen($file, 'w+');

42

43 foreach ($tables as $table)

63 $dumpBuffer = array();

64 $columns = array();

65 $fileHandle = is_resource($output) ? $output : fopen($output, 'w+');

66

67 // Append create query to file

Route.php (https://gitlab.com/mlassabe/LASSABE) PHP · 381 lines

1 <?php

2 /**

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

4 *

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

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

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

368 if ($this->outputBuffering === 'prepend') {

369 // prepend output buffer content

370 $body = new Http\Body(fopen('php://temp', 'r+'));

371 $body->write($output . $response->getBody());

372 $response = $response->withBody($body);

plain_file.cpp (https://github.com/kevlund/hiphop-php.git) C++ · 266 lines

1 /*

2 +----------------------------------------------------------------------+

3 | HipHop for PHP |

4 +----------------------------------------------------------------------+

5 | Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |

6 +----------------------------------------------------------------------+

7 | This source file is subject to version 3.01 of the PHP license, |

8 | that is bundled with this package in the file LICENSE, and is |

9 | available through the world-wide-web at the following url: |

51 ASSERT(m_fd == -1);

52

53 // For these definded in php fopen but C stream have different modes

54 switch (mode[0]) {

55 case 'x':

TesterTrait.php (https://gitlab.com/nmhieucoder/laravel_tintuc) PHP · 186 lines

139 $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately'];

140 if (!$this->captureStreamsIndependently) {

141 $this->output = new StreamOutput(fopen('php://memory', 'w', false));

142 if (isset($options['decorated'])) {

143 $this->output->setDecorated($options['decorated']);

152 );

153

154 $errorOutput = new StreamOutput(fopen('php://memory', 'w', false));

155 $errorOutput->setFormatter($this->output->getFormatter());

156 $errorOutput->setVerbosity($this->output->getVerbosity());

165 $streamProperty = $reflectedParent->getProperty('stream');

166 $streamProperty->setAccessible(true);

167 $streamProperty->setValue($this->output, fopen('php://memory', 'w', false));

168 }

169 }

FL_File.cs (https://github.com/Wiladams/NewTOAPIA.git) C# · 468 lines

18 public sector_buffer file_data;

19

20 // File fopen flags

21 public byte flags;

22 public const int FILE_READ = 0x01; // (1 << 0);

442

443 // Use read_file as this will check if the file is already open!

444 file = fl_fopen((char*)filename, "r");

445 if (file)

446 {

Stream.php (https://gitlab.com/reasonat/test8) PHP · 328 lines

1 <?php

2 /**

3 * Zend Framework (http://framework.zend.com/)

306 $error = $e;

307 }, E_WARNING);

308 $resource = fopen($stream, $mode);

309 restore_error_handler();

310 }

class.rss.php (https://github.com/stopassola/SlideshareAPIExamples.git) PHP · 255 lines

1 <?php

2

3 /***************************************************************************

8 * email : mgalesic@gmail.com

9 *

10 * Id: class.rss.php, v 1.1 2006/08/25

11 *

12 * www.starmont.net

223 $this->rss .= '</rss>';

224

225 $handle = fopen($this->path . '/'. $this->filename . '.xml', "w");

226 fwrite($handle, $this->rss);

227 fclose($handle);

class.Mailer.php (https://github.com/billfox3/ThinkUp.git) PHP · 88 lines

1 <?php

2 /**

3 *

4 * ThinkUp/webapp/_lib/model/class.Mailer.php

5 *

6 * Copyright (c) 2009-2011 Gina Trapani

46

47 $mail_header = "From: \"{$app_title}\" <notifications@{$host}>\r\n";

48 $mail_header .= "X-Mailer: PHP/".phpversion();

49

50 //don't send email when running tests, just write it to the filesystem for assertions

51 if ((isset($_SESSION["MODE"]) && $_SESSION["MODE"] == "TESTS") || getenv("MODE")=="TESTS") {

52 $test_email = THINKUP_WEBAPP_PATH . '_lib/view/compiled_view' . Mailer::EMAIL;

53 $fp = fopen($test_email, 'w');

54 fwrite($fp, $mail_header."\n");

55 fwrite($fp, "to: $to\n");

mail.php (https://gitlab.com/shapcy/opencart) PHP · 427 lines

103 $header .= 'Return-Path: ' . $this->from . PHP_EOL;

104 $header .= 'X-Mailer: PHP/' . phpversion() . PHP_EOL;

105 $header .= 'Content-Type: multipart/related; boundary="' . $boundary . '"' . PHP_EOL . PHP_EOL;

113 $message = '--' . $boundary . PHP_EOL;

114 $message .= 'Content-Type: multipart/alternative; boundary="' . $boundary . '_alt"' . PHP_EOL . PHP_EOL;

115 $message .= '--' . $boundary . '_alt' . PHP_EOL;

116 $message .= 'Content-Type: text/plain; charset="utf-8"' . PHP_EOL;

117 $message .= 'Content-Transfer-Encoding: 8bit' . PHP_EOL . PHP_EOL;

118

119 if ($this->text) {

126 $message .= 'Content-Type: text/html; charset="utf-8"' . PHP_EOL;

127 $message .= 'Content-Transfer-Encoding: 8bit' . PHP_EOL . PHP_EOL;

128 $message .= $this->html . PHP_EOL;

144 $message .= 'Content-ID: <' . basename(urlencode($attachment)) . '>' . PHP_EOL;

145 $message .= 'X-Attachment-Id: ' . basename(urlencode($attachment)) . PHP_EOL . PHP_EOL;

146 $message .= chunk_split(base64_encode($content));

147 }

createCityBuildings.php (https://gitlab.com/nacridan/Nacridan) PHP · 214 lines

1 <?php

2 require_once ("../conf/config.ini.php");

3 require_once (HOMEPATH . "/lib/DB.inc.php");

4 require_once (HOMEPATH . "/lib/utils.inc.php");

5 require_once (HOMEPATH . "/lib/MapInfo.inc.php");

6 $db = DB::getDB();

7

49 // ----- Bâtiments des Bourgs

50

51 $logfile = fopen('buildingcreation.log', 'a');

52

53 $dbc = new DBCollection("SELECT id,x,y FROM City WHERE type='Bourg' AND map=" . $map, $db, 0, 0);

functions.php (https://github.com/BenBE/ispCP.git) PHP · 275 lines

1 <?php

2 function todo_init(&$todos) {

3 if (defined('SM_PATH'))

4 include_once(SM_PATH . 'functions/prefs.php');

5 else

6 include_once('../functions/prefs.php');

10 clearstatcache();

11 $todo_filesize = @filesize("$hashed_dir/$username.todo");

12 $file = @fopen("$hashed_dir/$username.todo",'r');

13 $todos = @fread($file ,$todo_filesize);

14 @fclose($file);

57 function todo_save_todos(&$todos, $todo_count, $filename)

58 {

59 $file = @fopen($filename,'w');

60 // echo "count = ($todo_count)";

61 for ($i = 0;$i < $todo_count; $i++){

smarty_internal_data.php (https://github.com/hatone/revolution.git) PHP · 454 lines

1 <?php

2

3 /**

318 {

319 $_result = '';

320 if ($fp = fopen($variable, 'r+')) {

321 while (!feof($fp)) {

322 $_result .= fgets($fp);

Import.php (https://github.com/imr/horde.git) PHP · 206 lines

1 <?php

2 /**

3 * Copyright 2011-2014 Horde LLC (http://www.horde.org/)

115

116 if (!empty($zip_info)) {

117 $fd = fopen('php://temp', 'r+');

118

119 foreach (array_keys($zip_info) as $key) {

PostImageHandler.php (https://gitlab.com/wubbajack/insided-test) PHP · 288 lines

1 <?php namespace App\Core\Handlers;

2

3 use Intervention\Image\Constraint;

182 protected function copyFile(\SplFileInfo $file, $path)

183 {

184 $source = fopen($file, 'r');

185 $target = fopen($path, 'w+');

SubversionPropertiesSniff.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 206 lines

11 * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence

12 * @link http://pear.php.net/package/PHP_CodeSniffer

13 */

14

24 * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence

25 * @version Release: @package_version@

26 * @link http://pear.php.net/package/PHP_CodeSniffer

27 */

28 class Generic_Sniffs_VersionControl_SubversionPropertiesSniff implements PHP_CodeSniffer_Sniff

59 * Processes this test, when one of its tokens is encountered.

60 *

61 * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.

62 * @param int $stackPtr The position of the current token

63 * in the stack passed in $tokens.

65 * @return void

66 */

67 public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)

68 {

69 $tokens = $phpcsFile->getTokens();

AbstractDumper.php (https://gitlab.com/techniconline/kmc) PHP · 226 lines

1 <?php

2

3 /*

22 abstract class AbstractDumper implements DataDumperInterface, DumperInterface

23 {

24 public static $defaultOutput = 'php://output';

25

26 protected $line = '';

39 public function __construct($output = null, $charset = null)

40 {

41 $this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');

42 $this->decimalPoint = (string)0.5;

43 $this->decimalPoint = $this->decimalPoint[1];

64 } else {

65 if (is_string($output)) {

66 $output = fopen($output, 'wb');

67 }

68 $this->outputStream = $output;

test7.c (https://github.com/jvrao/nfs-ganesha.git) C · 306 lines

294 rmdirtree(1, files, 0, fname, dname, &totfiles, &totdirs, 1);

295

296 if((log = fopen(log_file, "a")) == NULL)

297 {

298 printf("Enable to open the file '%s'\n", log_file);

File.php (https://github.com/Riges/KawaiViewModel.git) PHP · 442 lines

1 <?php

2

3 /**

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

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

21 * @version $Id: File.php 24593 2012-01-05 20:35:02Z matthew $

22 */

23

25 * @see Zend_OpenId_Provider_Storage

26 */

27 require_once "Zend/OpenId/Provider/Storage.php";

28

29 /**

76 }

77 }

78 if (($f = fopen($this->_dir.'/assoc.lock', 'w+')) === null) {

79 throw new Zend_OpenId_Exception(

80 'Cannot create a lock file in the directory ' . $dir,

report.php (https://github.com/livinglab/openlab.git) PHP · 201 lines

1 <?php

2

3 /**

139 );

140

141 $fh = @fopen( 'php://output', 'w' );

142

143 //fprintf( $fh, chr(0xEF) . chr(0xBB) . chr(0xBF) );

demo.zip.php (https://github.com/KenBoyer/CompactCMS.git) PHP · 79 lines

1 <?php

2 /////////////////////////////////////////////////////////////////

3 /// getID3() by James Heinrich <info@getid3.org> //

6 /////////////////////////////////////////////////////////////////

7 // //

8 // /demo/demo.zip.php - part of getID3() //

9 // Sample script how to use getID3() to decompress zip files //

10 // See readme.txt for more details //

16 $errors = array();

17 $DecompressedFileContents = array();

18 if (include_once('getid3.module.archive.zip.php')) {

19 ob_start();

20 if ($fp_ziptemp = fopen($filename, 'rb')) {

69 $error_message = ob_get_contents();

70 ob_end_clean();

71 $errors[] = 'failed to fopen('.$filename.', rb): '.$error_message;

72 }

73 } else {

comments.class.php (https://github.com/dotted/JibberBook.git) PHP · 222 lines

1 <?php

2 /*

3 Class: Comments

18 public function __construct() {

19 $this->filename = realpath(dirname(__FILE__) . '/' . JB_XML_FILENAME);

20 $this->handle = @fopen($this->filename, 'r+') or die('<p><strong>Error:</strong> Could not open XML file. Make sure your server has correct permissions.</p>');

21 flock($this->handle, LOCK_EX);

22 }

Base64.cpp (https://gitlab.com/swinkelhofer/ownApps) C++ · 338 lines

98 if(sourceformat->currentIndex() == 0 && destinationformat->currentIndex() == 0)

99 {

100 FILE *in = fopen(QFileDialog::getOpenFileName(this, "Datei �ffnen", QDir::currentPath(), "Alle Dateien (*.*)").toStdString().c_str(), "rb");

101 FILE *out = fopen(QFileDialog::getSaveFileName(this, "Speichern unter", QDir::currentPath(), "Alle Dateien (*.*)").toStdString().c_str(), "w+b");

mass-reapprov.php (https://github.com/Eyepea/xivo-gallifrey.git) PHP · 148 lines

1 #! /usr/bin/php -q

2 <?php

39 $total = $ok = $err = 0;

40

41 $handle = fopen($csv,'r');

42

43 $r = array();

DiscISAM.php (https://github.com/Tassader/Spedicka.git) PHP · 219 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 1.8.0, 2014-03-02

34 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)

35 */

36 class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage_CacheBase implements PHPExcel_CachedObjectStorage_ICache {

37

38 /**

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

90 */

91 public function addCacheData($pCoord, PHPExcel_Cell $cell) {

92 if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) {

93 $this->_storeData();

povray.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 519 lines

209 <KEYWORD2>fog_offset</KEYWORD2>

210 <KEYWORD2>fog_type</KEYWORD2>

211 <KEYWORD1>#fopen</KEYWORD1>

212 <KEYWORD2>form</KEYWORD2>

213 <LITERAL1>frame_number</LITERAL1>

pl-sql.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 395 lines

377 <KEYWORD3>FCLOSE_ALL</KEYWORD3>

378 <KEYWORD3>FILE_TYPE</KEYWORD3>

379 <KEYWORD3>FOPEN</KEYWORD3>

380 <KEYWORD3>INVALID_OPERATION</KEYWORD3>

381 <KEYWORD3>INVALID_PATH</KEYWORD3>

maple.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 736 lines

292 <FUNCTION>fnormal</FUNCTION>

293 <FUNCTION>fold</FUNCTION>

294 <FUNCTION>fopen</FUNCTION>

295 <FUNCTION>forall</FUNCTION>

296 <FUNCTION>forget</FUNCTION>

segment.c (https://swig.svn.sourceforge.net/svnroot/swig) C · 228 lines ✨ Summary

This C code provides access to a process’s virtual memory map, including executable segments, data segments, shared libraries, and memory mapped regions. It reads the segment map from the /proc/self/maps file on Linux systems and the /proc/self/map file on Solaris machines. The code stores the information in a linked list of WadSegment structures, allowing for easy access to the process’s virtual address space.

82 segment_open() {

83 FILE *f;

84 f = fopen("/proc/self/maps", "r");

85 linux_first =1;

86 return (int) f;

D3D_MAIN.CPP (https://jetpp.svn.sourceforge.net/svnroot/jetpp) Unknown · 3001 lines

314 wvsprintf(Buffer, Str, (char*)(&Str+1));

315

316 f = fopen(D3DMAIN_LOG_FILENAME, "a+t");

317

318 if (!f)

pl-sql.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 503 lines

479 <KEYWORD3>FEEDBACK</KEYWORD3>

480 <KEYWORD3>FILE_TYPE</KEYWORD3>

481 <KEYWORD3>FOPEN</KEYWORD3>

482 <KEYWORD3>HEAD</KEYWORD3>

483 <KEYWORD3>INVALID_OPERATION</KEYWORD3>

v3.4beta028.html (https://bitbucket.org/ultra_iter/qt-vtl.git) HTML · 146 lines

117

118 <UL>

119 <LI>the <TT>TIFFOpen</TT> page has been updated to reflect the new

120 optional open mode parameters

121 </UL>

foxpro.xml (https://jedit.svn.sourceforge.net/svnroot/jedit) XML · 1762 lines

991 <KEYWORD3>FontClass</KEYWORD3>

992 <KEYWORD3>Fontmetric</KEYWORD3>

993 <KEYWORD3>Fopen</KEYWORD3>

994 <KEYWORD3>For</KEYWORD3>

995 <KEYWORD3>Form</KEYWORD3>

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

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

121 <td width="91%">

122 <p><big><b>TIFFOpen</b>(3TIFF),

123 <b>TIFFReadRawStrip</b>(3TIFF),

124 <b>TIFFReadScanline</b>(3TIFF),

output_example.c (http://amv-codec-tools.googlecode.com/svn/trunk/) C · 549 lines ✨ Summary

This C code is an example of a media file output program using libavformat, libavcodec, and libavutil libraries. It takes a filename as input, detects the output format from the extension, and outputs a media file with interleaved audio and video streams. The program can write raw images or use default codecs for audio and video streams.

489 /* open the output file, if needed */

490 if (!(fmt->flags & AVFMT_NOFILE)) {

491 if (url_fopen(&oc->pb, filename, URL_WRONLY) < 0) {

492 fprintf(stderr, "Could not open '%s'\n", filename);

493 exit(1);

D3DDRV.CPP (https://jetpp.svn.sourceforge.net/svnroot/jetpp) C++ · 606 lines ✨ Summary

This C++ code is part of a game engine, specifically for Direct3D graphics rendering. It provides functions to handle various graphical operations such as:

  • Capturing the screen as an image
  • Setting fog effects in the scene
  • Drawing text on the screen
  • Locking and unlocking the back buffer for rendering

These functions are likely used within a larger game engine framework to control the visual output of the application.

454 return JE_FALSE;

455

456 out = fopen(Name, "wb");

457

458 if (!out)

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.

562 else {

563 lua_pushfstring(L, "@%s", filename);

564 lf.f = fopen(filename, "r");

565 if (lf.f == NULL) return errfile(L, "open", fnameindex);

566 }

573 if (c == LUA_SIGNATURE[0] && lf.f != stdin) { /* binary file? */

574 fclose(lf.f);

575 lf.f = fopen(filename, "rb"); /* reopen in binary mode */

576 if (lf.f == NULL) return errfile(L, "reopen", fnameindex);

577 /* skip eventual `#!...' */

word_count_functor.flex (http://hadesmem.googlecode.com/svn/trunk/) text · 0 lines

36 int tok = EOF;

37 int c = 0, w = 0, l = 0;

38 yyin = fopen(1 == argc ? "word_count.input" : argv[1], "r");

39 if (NULL == yyin) {

40 fprintf(stderr, "Couldn't open input file!\n");

PdnShell.cpp (http://paint-mono.googlecode.com/svn/trunk/) C++ · 150 lines ✨ Summary

This C++ code is a DLL (Dynamic Link Library) implementation for Paint.NET, a free image editing software. It provides a COM (Component Object Model) interface to the library’s functionality, allowing other applications to interact with it. The code handles initialization, unloading, and class registration for the library, as well as logging and error handling.

39

40 FILE *flog = NULL;

41 errno_t err = fopen_s(&flog, "C:\\log.txt", "a");

42

43 if (0 == err && NULL != flog)

mpstat.c (git://pkgs.fedoraproject.org/busybox) C · 978 lines

459 char buf[1024];

460

461 fp = xfopen_for_read(PROCFS_STAT);

462

463 while (fgets(buf, sizeof(buf), fp)) {

523 char buf[1024];

524

525 fp = fopen_for_read(PROCFS_STAT);

526 if (!fp)

527 return;

568 // }

569

570 fp = fopen_for_read(fname);

571 if (!fp)

572 return;

stream.php (https://bitbucket.org/kraymitchell/fcd.git) PHP · 1454 lines

27 * @see http://php.net/manual/en/function.stream-get-wrappers.php

28 * @see http://php.net/manual/en/intro.stream.php PHP Stream Manual

29 * @see http://php.net/manual/en/wrappers.php Stream Wrappers

30 * @see http://php.net/manual/en/filters.php Stream Filters

31 * @see http://php.net/manual/en/transports.php Socket Transports (used by some options, particularly HTTP proxy)

525 * @return mixed

526 *

527 * @see http://php.net/manual/en/function.fread.php

528 * @since 11.1

529 */

941 * @see http://php.net/stream_context_create Stream Context Creation

942 * @see http://php.net/manual/en/context.php Context Options for various streams

943 * @since 11.1

944 */

file.c (https://bitbucket.org/cabalistic/ogredeps/) C · 1181 lines ✨ Summary

This C code provides functions for interacting with ZIP archives, specifically for reading and writing data from a ZIP file. It includes functions for reading and writing data in various modes (e.g., unstore, inflate), seeking to specific positions within the archive, and telling the current position of the read/write cursor. The code also handles large file mode limitations by providing alternative 32-bit versions of these functions.

521 /* ------------------------------------------------------------------- */

522

523 /** also: fopen(2)

524 * This function will => fopen(3) a real/zipped file.

540 * a string which allows for more freedom to support the extra

541 * zzip modes called ZZIP_CASEINSENSITIVE and ZZIP_IGNOREPATH.

542 * Currently, this => zzip_fopen call will convert the following

543 * characters in the mode-string into their corrsponding mode-bits:

544 * * <code> "r" : O_RDONLY : </code> read-only

569 */

570 ZZIP_FILE *

571 zzip_fopen(zzip_char_t * filename, zzip_char_t * mode)

572 {

573 return zzip_freopen(filename, mode, 0);

574 }

575

576 /** => zzip_fopen

577 *

578 * This function receives an additional argument pointing to