100+ results for 'php is_resource'

Not the results you expected?

Collection.php (https://github.com/fruux/sabre-dav.git) PHP · 168 lines

1 <?php declare (strict_types=1);

2

3 namespace Sabre\DAV\Mock;

91 function createFile($name, $data = '') {

92

93 if (is_resource($data)) {

94 $data = stream_get_contents($data);

95 }

cubrid_result.php (https://github.com/dchill42/CodeIgniter.git) PHP · 170 lines

1 <?php

2 /**

3 * CodeIgniter

4 *

5 * An open source application development framework for PHP 5.2.4 or newer

6 *

7 * NOTICE OF LICENSE

111 public function free_result()

112 {

113 if (is_resource($this->result_id) OR

114 (get_resource_type($this->result_id) === 'Unknown' && preg_match('/Resource id #/', strval($this->result_id))))

115 {

167 }

168

169 /* End of file cubrid_result.php */

170 /* Location: ./system/database/drivers/cubrid/cubrid_result.php */

LoggerAppenderDailyFile.php (https://gitlab.com/lishaomin/qwp) PHP · 130 lines

1 <?php

2 /**

3 * Licensed to the Apache Software Foundation (ASF) under one or more

22 * The file is rolled over once a day. That means, for each day a new file

23 * is created. A formatted version of the date pattern is used as to create

24 * the file name using the {@link PHP_MANUAL#sprintf} function.

25 *

26 * This appender uses a layout.

29 *

30 * - **datePattern** - Format for the date in the file path, follows formatting

31 * rules used by the PHP date() function. Default value: "Ymd".

32 * - **file** - Path to the target file. Should contain a %s which gets

33 * substituted by the date.

36 *

37 * @version $Revision: 1382274 $

38 * @package log4php

39 * @subpackage appenders

40 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0

lmbSqliteConnection.class.php (https://github.com/idler/limb.git) PHP · 184 lines

1 <?php

2 /*

3 * Limb PHP Framework

8 */

9

10 lmb_require('limb/dbal/src/drivers/lmbDbBaseConnection.class.php');

11 lmb_require(dirname(__FILE__) . '/lmbSqliteDbInfo.class.php');

12 lmb_require(dirname(__FILE__) . '/lmbSqliteQueryStatement.class.php');

13 lmb_require(dirname(__FILE__) . '/lmbSqliteInsertStatement.class.php');

14 lmb_require(dirname(__FILE__) . '/lmbSqliteDropStatement.class.php');

15 lmb_require(dirname(__FILE__) . '/lmbSqliteManipulationStatement.class.php');

16 lmb_require(dirname(__FILE__) . '/lmbSqliteStatement.class.php');

17 lmb_require(dirname(__FILE__) . '/lmbSqliteTypeInfo.class.php');

query.class.php (https://github.com/konfirm/konsolidate.git) PHP · 158 lines

1 <?php

2

3 /*

70 $this->_result = @sqlite_query( $this->query, $this->_conn, SQLITE_BOTH, $sError );

71

72 if ( is_resource( $this->_result ) )

73 $this->rows = sqlite_num_rows( $this->_result );

74

75 // We want the exception object to tell us everything is going extremely well, don't throw it!

76 $this->import( "../exception.class.php" );

77 $this->exception = new CoreDBSQLiteException( sqlite_last_error( $this->_conn ) );

78 $this->errno = &$this->exception->errno;

90 public function rewind()

91 {

92 if ( is_resource( $this->_result ) && sqlite_num_rows( $this->_result ) > 0 )

93 return sqlite_rewind( $this->_result );

94 return false;

Stream.php (https://github.com/Rovak/zf2.git) PHP · 151 lines

1 <?php

2 /**

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

28 * @var string

29 */

30 protected $logSeparator = PHP_EOL;

31

32 /**

33 * Holds the PHP stream to log to.

34 *

35 * @var null|stream

64 }

65

66 if (is_resource($streamOrUrl)) {

67 if ('stream' != get_resource_type($streamOrUrl)) {

68 throw new Exception\InvalidArgumentException(sprintf(

StreamTest.php (https://github.com/ibnoe/Microweber.git) PHP · 176 lines

1 <?php

2 require_once MIO_PATH . 'Stream.php';

3 require_once MIO_PATH . 'Exception.php';

4

5 class MioStreamTest extends UnitTestCase

20 public function tearDown()

21 {

22 if( is_resource( $this->server ) ) {

23 fclose( $this->server );

24 }

Snapshot.php (https://gitlab.com/ealexis.t/trends) PHP · 423 lines

1 <?php

2 /*

3 * This file is part of the GlobalState package.

4 *

5 * (c) Sebastian Bergmann <sebastian@phpunit.de>

6 *

7 * For the full copyright and license information, please view the LICENSE

404 {

405 if (!is_object($variable)) {

406 return !is_resource($variable);

407 }

408

dumper.php (https://github.com/quarkness/piwik.git) PHP · 360 lines

1 <?php

2 /**

3 * base include file for SimpleTest

4 * @package SimpleTest

5 * @subpackage UnitTester

6 * @version $Id: dumper.php 1723 2008-04-08 00:34:10Z lastcraft $

7 */

8 /**

64 } elseif (is_array($value)) {

65 return "Array";

66 } elseif (is_resource($value)) {

67 return "Resource";

68 } elseif (is_object($value)) {

Session.php (https://github.com/brtriver/sukonv.git) PHP · 300 lines

1 <?php

2 /**

3 * Lithium: the most rad php framework

4 *

5 * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)

6 * @license http://opensource.org/licenses/bsd-license.php The BSD License

7 */

8

137 $options += $defaults;

138

139 if (is_resource($value) || !static::$_configurations) {

140 return false;

141 }

class.DbOdbc.php (https://github.com/palmic/2yaml.git) PHP · 217 lines

1 <?php

2

3

40

41 public function fetchAssoc($result) {

42 if (!is_resource($result)) {

43 throw new DbControlException("Ilegal parameter result. Must be valid result resource.");

44 }

84

85 public function getNumRows(/*resource*/ $result) {

86 if (!is_resource($result)) {

87 throw new DbControlException("Ilegal parameter result. Must be valid result resource.");

88 }

93

94 public function getColnames(/*resource*/ $result) {

95 if (!is_resource($result)) {

96 throw new DbControlException("Ilegal parameter result. Must be valid result resource.");

97 }

YamlDumper.php (https://gitlab.com/Snizer/PI-DEV-TUNISIAMALL3A6-WEB) PHP · 336 lines

1 <?php

2

3 /*

247 } elseif ($value instanceof Expression) {

248 return $this->getExpressionCall((string) $value);

249 } elseif (is_object($value) || is_resource($value)) {

250 throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');

251 }

dumper.php (https://github.com/greevex/mzz-framework-blank-application.git) PHP · 360 lines

1 <?php

2 /**

3 * base include file for SimpleTest

4 * @package SimpleTest

5 * @subpackage UnitTester

6 * @version $Id: dumper.php 2460 2008-04-08 21:03:22Z mz $

7 */

8 /**

64 } elseif (is_array($value)) {

65 return "Array";

66 } elseif (is_resource($value)) {

67 return "Resource";

68 } elseif (is_object($value)) {

file_handling_over_ftp.php (https://github.com/ameximes/akelos.git) PHP · 291 lines

1 <?php

2

3 //

6 if(!defined('AK_UPLOAD_FILES_USING_FTP')){

7 if(!function_exists('ftp_connect')){

8 echo "PHP is not compiled with FTP support\n";

9 return;

10 }

20 }

21

22 require_once(dirname(__FILE__).'/../config.php');

23

24 class FileHandlingOverFtp_TestCase extends ActiveSupportUnitTest

115 $connection = AkFtp::connect();

116 $this->assertTrue($connection);

117 $this->assertTrue(is_resource($connection) && get_resource_type($connection) == 'FTP Buffer');

118 $this->assertIdentical($connection, AkFtp::connect());

119 }

Default.php (https://gitlab.com/rsilveira1987/Expresso) PHP · 312 lines

1 <?php

2 /**

3 * Zend Framework

86 * @see Zend_Ldap_Exception

87 */

88 require_once 'Zend/Ldap/Exception.php';

89 throw new Zend_Ldap_Exception($this->_ldap, 'counting entries');

90 }

104 {

105 $isClosed = false;

106 if (is_resource($this->_resultId)) {

107 $isClosed = @ldap_free_result($this->_resultId);

108 $this->_resultId = null;

192 public function current()

193 {

194 if (!is_resource($this->_current)) {

195 $this->rewind();

196 }

streams.php (https://github.com/muskmelon/Greemo.git) PHP · 209 lines

1 <?php

2 /**

3 * Classes, which help reading streams of data from files.

4 * Based on the classes from Danilo Segan <danilo@kvota.net>

5 *

6 * @version $Id: streams.php 406 2010-02-07 11:10:24Z nbachiyski $

7 * @package pomo

8 * @subpackage streams

93 }

94

95 function is_resource() {

96 return true;

97 }

122 }

123

124 function is_resource() {

125 return is_resource($this->_f);

dumper.php (https://github.com/kugu/limb.git) PHP · 360 lines

1 <?php

2 /**

3 * base include file for SimpleTest

4 * @package SimpleTest

5 * @subpackage UnitTester

6 * @version $Id: dumper.php 7198 2008-11-01 11:57:17Z korchasa $

7 */

8 /**

64 } elseif (is_array($value)) {

65 return "Array";

66 } elseif (is_resource($value)) {

67 return "Resource";

68 } elseif (is_object($value)) {

Default.php (https://bitbucket.org/acidel/buykoala.git) PHP · 310 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: Default.php 20096 2010-01-06 02:05:09Z bkarwin $

20 */

21

86 * @see Zend_Ldap_Exception

87 */

88 #require_once 'Zend/Ldap/Exception.php';

89 throw new Zend_Ldap_Exception($this->_ldap, 'counting entries');

90 }

104 {

105 $isClosed = false;

106 if (is_resource($this->_resultId)) {

107 $isClosed = @ldap_free_result($this->_resultId);

108 $this->_resultId = null;

StreamHandlerTest.php (https://gitlab.com/ealexis.t/trends) PHP · 184 lines

1 <?php

2

3 /*

23 public function testWrite()

24 {

25 $handle = fopen('php://memory', 'a+');

26 $handler = new StreamHandler($handle);

27 $handler->setFormatter($this->getIdentityFormatter());

38 public function testCloseKeepsExternalHandlersOpen()

39 {

40 $handle = fopen('php://memory', 'a+');

41 $handler = new StreamHandler($handle);

42 $this->assertTrue(is_resource($handle));

43 $handler->close();

44 $this->assertTrue(is_resource($handle));

45 }

46

image.php (https://gitlab.com/valced/anchor-cms) PHP · 258 lines

1 <?php

2

3 class Image {

68 $res = $this->src_image;

69

70 if(is_resource($this->dst_image)) {

71 $res = $this->dst_image;

72 }

92 $res = $this->src_image;

93

94 if(is_resource($this->dst_image)) {

95 $res = $this->dst_image;

96 }

116 $res = $this->src_image;

117

118 if(is_resource($this->dst_image)) {

119 $res = $this->dst_image;

120 }

SocketHandlerTest.php (https://bitbucket.org/laborautonomo/laborautonomo-site.git) PHP · 283 lines

1 <?php

2

3 /*

223 $this->assertInternalType('resource', $this->res);

224 $this->handler->close();

225 $this->assertFalse(is_resource($this->res), "Expected resource to be closed after closing handler");

226 }

227

231 $this->handler->setPersistent(true);

232 $this->writeRecord('Hello world');

233 $this->assertTrue(is_resource($this->res));

234 $this->handler->close();

235 $this->assertTrue(is_resource($this->res));

249 private function setMockHandler(array $methods = array())

250 {

251 $this->res = fopen('php://memory', 'a');

252

253 $defaultMethods = array('fsockopen', 'pfsockopen', 'streamSetTimeout');

GifCreator.php (https://gitlab.com/billyprice1/mc-skintools) PHP · 349 lines

1 <?php

2

3 namespace GifCreator;

8 * @link https://github.com/Sybio/GifCreator

9 * @author Sybio (Clément Guillemain / @Sybio01)

10 * @license http://opensource.org/licenses/gpl-license.php GNU Public License

11 * @copyright Clément Guillemain

12 * @modified by Max Korlaar

93 for ($i = 0; $i < count($frames); $i++) {

94

95 if (is_resource($frames[$i])) { // Resource var

96

97 $resourceImg = $frames[$i];

YamlDumper.php (https://github.com/zeopix/TaskBoxx.git) PHP · 266 lines

1 <?php

2

3 /*

187 } elseif (is_object($value) && $value instanceof Parameter) {

188 return $this->getParameterCall((string) $value);

189 } elseif (is_object($value) || is_resource($value)) {

190 throw new \RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');

191 }

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

25 protected function tearDown()

26 {

27 if (is_resource($this->stream) === true) {

28 fclose($this->stream);

29 }

FilesystemAdapter.php (https://gitlab.com/Sigpot/AirSpot) PHP · 383 lines

1 <?php

2

3 namespace Illuminate\Filesystem;

79 }

80

81 if (is_resource($contents)) {

82 return $this->driver->putStream($path, $contents, $config);

83 } else {

120 * @return int

121 */

122 public function prepend($path, $data, $separator = PHP_EOL)

123 {

124 if ($this->exists($path)) {

136 * @return int

137 */

138 public function append($path, $data, $separator = PHP_EOL)

139 {

140 if ($this->exists($path)) {

Stream.php (https://bitbucket.org/nbravo777/repo_ratchet.git) PHP · 296 lines

1 <?php

2

3 namespace Guzzle\Stream;

6

7 /**

8 * PHP stream implementation

9 */

10 class Stream implements StreamInterface

77 public function close()

78 {

79 if (is_resource($this->stream)) {

80 fclose($this->stream);

81 }

125 public function setStream($stream, $size = null)

126 {

127 if (!is_resource($stream)) {

128 throw new InvalidArgumentException('Stream must be a resource');

129 }

Default.php (https://gitlab.com/devtoannh/cafe) PHP · 310 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: Default.php 23775 2011-03-01 17:25:24Z ralph $

20 */

21

86 * @see Zend_Ldap_Exception

87 */

88 require_once 'Zend/Ldap/Exception.php';

89 throw new Zend_Ldap_Exception($this->_ldap, 'counting entries');

90 }

104 {

105 $isClosed = false;

106 if (is_resource($this->_resultId)) {

107 $isClosed = @ldap_free_result($this->_resultId);

108 $this->_resultId = null;

File.php (https://gitlab.com/Ltaimao/wecenter) PHP · 198 lines

1 <?php

2 /**

3 * Zend Framework

22

23 /** Zend_Pdf_FileParserDataSource */

24 //require_once 'Zend/Pdf/FileParserDataSource.php';

25

26

76 {

77 if (! (is_file($filePath) || is_link($filePath))) {

78 //require_once 'Zend/Pdf/Exception.php';

79 throw new Zend_Pdf_Exception("Invalid file path: $filePath",

80 Zend_Pdf_Exception::BAD_FILE_PATH);

81 }

82 if (! is_readable($filePath)) {

83 //require_once 'Zend/Pdf/Exception.php';

84 throw new Zend_Pdf_Exception("File is not readable: $filePath",

85 Zend_Pdf_Exception::NOT_READABLE);

FileRepository_Backend_MySQL.class.php (https://github.com/cj/Project-Pier.git) PHP · 443 lines

1 <?php

2

3 /**

164 } // if

165

166 if (is_object($attribute_value) || is_resource($attribute_value)) {

167 throw new InvalidParamError('$attribute_value', $attribute_value, 'Objects and resources are not supported as attribute values');

168 } // if

413 function setDbLink($value) {

414 trace(__FILE__, '__setDbLink()');

415 if (!is_resource($value) || (strpos(get_resource_type($value), 'mysql') === false)) {

416 throw new InvalidParamError('value', $value, 'DB link need to be MySQL connection resouce');

417 } // if

LoggerDataCollector.php (https://gitlab.com/milton2913/myBlog) PHP · 213 lines

1 <?php

2

3 /*

164 }

165

166 if (is_resource($context)) {

167 return sprintf('Resource(%s)', get_resource_type($context));

168 }

FlattenException.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 297 lines

1 <?php

2

3 /*

15

16 /**

17 * FlattenException wraps a PHP Exception to be able to serialize it.

18 *

19 * Basically, this class removes all objects from the trace.

56

57 /**

58 * FlattenException wraps a PHP Exception to be able to serialize it.

59 *

60 * Basically, this class removes all objects from the trace.

276 } elseif (is_bool($value)) {

277 $result[$key] = array('boolean', $value);

278 } elseif (is_resource($value)) {

279 $result[$key] = array('resource', get_resource_type($value));

280 } elseif ($value instanceof \__PHP_Incomplete_Class) {

util.c (https://bitbucket.org/osmanov/pecl-event.git) C · 200 lines

40 if ((stream = (php_stream *)zend_fetch_resource2(Z_RES_P(pfd), NULL, php_file_le_stream(), php_file_le_pstream())) != NULL) {

41 if (php_stream_is(stream, PHP_STREAM_IS_MEMORY) || php_stream_is(stream, PHP_STREAM_IS_TEMP)) {

42 zend_throw_exception(zend_ce_exception,

43 "Cannot fetch file descriptor from memory based stream", 0);

55 if (php_stream_can_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL) == SUCCESS) {

56 if (php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,

57 (void *) &file_desc, 1) != SUCCESS || file_desc < 0) {

58 return -1;

60 } else if (php_stream_can_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_INTERNAL) == SUCCESS) {

61 if (php_stream_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_INTERNAL,

62 (void *) &file_desc, 1) != SUCCESS || file_desc < 0) {

63 return -1;

64 }

65 } else if (php_stream_can_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_INTERNAL) == SUCCESS) {

66 if (php_stream_cast(stream, PHP_STREAM_AS_STDIO,

Default.php (https://gitlab.com/Ltaimao/wecenter) PHP · 312 lines

1 <?php

2 /**

3 * Zend Framework

86 * @see Zend_Ldap_Exception

87 */

88 //require_once 'Zend/Ldap/Exception.php';

89 throw new Zend_Ldap_Exception($this->_ldap, 'counting entries');

90 }

104 {

105 $isClosed = false;

106 if (is_resource($this->_resultId)) {

107 $isClosed = @ldap_free_result($this->_resultId);

108 $this->_resultId = null;

192 public function current()

193 {

194 if (!is_resource($this->_current)) {

195 $this->rewind();

196 }

Filesystem.php (https://gitlab.com/puleeno/fiona-fashion) PHP · 400 lines

1 <?php

2

3 namespace League\Flysystem;

74 public function writeStream($path, $resource, array $config = [])

75 {

76 if ( ! is_resource($resource)) {

77 throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.');

78 }

107 public function putStream($path, $resource, array $config = [])

108 {

109 if ( ! is_resource($resource)) {

110 throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.');

111 }

158 public function updateStream($path, $resource, array $config = [])

159 {

160 if ( ! is_resource($resource)) {

161 throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.');

162 }

Default.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 312 lines

1 <?php

2 /**

3 * Zend Framework

86 * @see Zend_Ldap_Exception

87 */

88 #require_once 'Zend/Ldap/Exception.php';

89 throw new Zend_Ldap_Exception($this->_ldap, 'counting entries');

90 }

104 {

105 $isClosed = false;

106 if (is_resource($this->_resultId)) {

107 $isClosed = @ldap_free_result($this->_resultId);

108 $this->_resultId = null;

192 public function current()

193 {

194 if (!is_resource($this->_current)) {

195 $this->rewind();

196 }

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

1 <?php

2

3 /**

130 $this->writeFD = $writeFD;

131

132 if (!is_resource($this->readFD)) {

133 throw new BadStreamDescriptorException('wrong readFD', 1);

134 }

175 }

176

177 if (!is_resource($this->writeFD)) {

178 throw new BadStreamDescriptorException('wrong writeFD',1);

179 }

215

216 public function closeRead() {

217 if (is_resource($this->readBuf)) {

218 if (event_buffer_free($this->readBuf) === FALSE) {

219 $this->readBuf = FALSE;

Default.php (https://github.com/praveensingh85/MyEventDashboard1.git) PHP · 310 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: Default.php 20096 2010-01-06 02:05:09Z bkarwin $

20 */

21

86 * @see Zend_Ldap_Exception

87 */

88 require_once 'Zend/Ldap/Exception.php';

89 throw new Zend_Ldap_Exception($this->_ldap, 'counting entries');

90 }

104 {

105 $isClosed = false;

106 if (is_resource($this->_resultId)) {

107 $isClosed = @ldap_free_result($this->_resultId);

108 $this->_resultId = null;

Default.php (https://bitbucket.org/gkawka/zend-framework.git) PHP · 312 lines

1 <?php

2 /**

3 * Zend Framework

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

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

19 * @version $Id: Default.php 24612 2012-01-21 14:42:30Z sgehrig $

20 */

21

86 * @see Zend_Ldap_Exception

87 */

88 require_once 'Zend/Ldap/Exception.php';

89 throw new Zend_Ldap_Exception($this->_ldap, 'counting entries');

90 }

104 {

105 $isClosed = false;

106 if (is_resource($this->_resultId)) {

107 $isClosed = @ldap_free_result($this->_resultId);

108 $this->_resultId = null;

StreamTest.php (https://gitlab.com/ealexis.t/trends) PHP · 161 lines

1 <?php

2 namespace GuzzleHttp\Tests\Psr7;

3

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());

YamlDumper.php (https://bitbucket.org/vvanuytven/php_auto.git) PHP · 316 lines

1 <?php

2

3 /*

232 } elseif ($value instanceof Parameter) {

233 return $this->getParameterCall((string) $value);

234 } elseif (is_object($value) || is_resource($value)) {

235 throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');

236 }

Default.php (https://bitbucket.org/ksekar/campus.git) PHP · 312 lines

1 <?php

2 /**

3 * Zend Framework

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

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

19 * @version $Id: Default.php 24613 2012-01-21 14:44:26Z sgehrig $

20 */

21

86 * @see Zend_Ldap_Exception

87 */

88 require_once 'Zend/Ldap/Exception.php';

89 throw new Zend_Ldap_Exception($this->_ldap, 'counting entries');

90 }

104 {

105 $isClosed = false;

106 if (is_resource($this->_resultId)) {

107 $isClosed = @ldap_free_result($this->_resultId);

108 $this->_resultId = null;

MysqlDBAdapter.class.php (https://gitlab.com/x33n/ProjectPier-Core) PHP · 335 lines

1 <?php

2

3 /**

29 @mysql_connect($host, $user, $pass);

30

31 if (!is_resource($link)) {

32 throw new DBConnectError($host, $user, $pass, $database);

33 } // if

MySQL.php (https://gitlab.com/ptisky/API_prestashop) PHP · 224 lines

1 <?php

2 /**

3 * 2007-2015 PrestaShop

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

21 * @author PrestaShop SA <contact@prestashop.com>

22 * @copyright 2007-2015 PrestaShop SA

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

24 * International Registered Trademark & Property of PrestaShop SA

25 */

76 {

77 $return = false;

78 if(is_resource($result) && $result)

79 $return = mysql_fetch_assoc($result);

80 elseif(is_resource($this->result) && $this->result)

File.php (https://github.com/Exercise/zf2.git) PHP · 193 lines

1 <?php

2 /**

3 * Zend Framework

105 public function __destruct()

106 {

107 if (is_resource($this->_fileResource)) {

108 @fclose($this->_fileResource);

109 }

Abstract.php (https://gitlab.com/skokkk/CleverSpeak) PHP · 268 lines

1 <?php

2

3 /**

4 * @file

5 * TeamSpeak 3 PHP Framework

6 *

7 * $Id: Abstract.php 10/11/2013 11:35:22 scp@orilla $

240 public function isConnected()

241 {

242 return (is_resource($this->stream)) ? TRUE : FALSE;

243 }

244

cake_socket.php (https://github.com/cgajardo/repositorium.git) PHP · 304 lines

1 <?php

2 /**

3 * Cake Socket connection class.

5 * PHP versions 4 and 5

6 *

7 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)

8 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)

9 *

12 *

13 * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)

14 * @link http://cakephp.org CakePHP(tm) Project

15 * @package cake

16 * @subpackage cake.cake.libs

17 * @since CakePHP(tm) v 1.2.0

18 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)

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

1 <?hh

2 // @generated by idl-to-hni.php

3

4 /* Finds whether the given variable is a boolean.

70 */

71 <<__Native>>

72 function is_resource(mixed $var): bool;

73

74 /* Finds whether the given variable is NULL.

77 function is_null(mixed $var): bool;

78

79 /* Returns the type of the PHP variable var. Warning Never use gettype() to

80 * test for a certain type, since the returned string may be subject to change

81 * in a future version. In addition, it is slow too, as it involves string

120 /* print_r() displays information about a variable in a way that's readable by

121 * humans. print_r(), var_dump() and var_export() will also show protected

122 * and private properties of objects with PHP 5. Static class members will not

123 * be shown. Remember that print_r() will move the array pointer to the end.

124 * Use reset() to bring it back to beginning.

Serializer.php (https://github.com/ap0ught/symfony.git) PHP · 328 lines

1 <?php

2

3 /*

175 }

176

177 throw new NotNormalizableValueException('An unexpected value could not be normalized: '.(!\is_resource($data) ? var_export($data, true) : sprintf('%s resource', get_resource_type($data))));

178 }

179

transport_connection.php (https://github.com/kamarulismail/kamarul-playground.git) PHP · 257 lines

1 <?php

2 /**

3 * File containing the ezcMailTransportConnection class

48 * transport connection.

49 *

50 * @todo The @ should be removed when PHP doesn't throw warnings for connect problems.

51 *

52 * @throws ezcMailTransportException

78 if ( ezcBaseFeatures::hasExtensionSupport( 'openssl' ) !== true )

79 {

80 throw new ezcBaseExtensionNotFoundException( 'openssl', null, "PHP not configured --with-openssl." );

81 }

82 $this->connection = @stream_socket_client( "ssl://{$server}:{$port}",

89 }

90

91 if ( is_resource( $this->connection ) )

92 {

93 stream_set_timeout( $this->connection, $this->options->timeout );

Combine.php (https://github.com/markn86/moodle.git) PHP · 315 lines

1 <?php

2 /**

3 * Copyright 2009-2017 Horde LLC (http://www.horde.org/)

84 * a single stream.

85 *

86 * @return resource A PHP stream.

87 */

88 public static function getStream($data)

128 foreach ($data as $val) {

129 if (is_string($val)) {

130 $fp = fopen('php://temp', 'r+');

131 fwrite($fp, $val);

132 } else {

167

168 while ($count) {

169 if (!is_resource($tmp['fp'])) {

170 return false;

171 }

NodeTest.php (https://github.com/misja/librdf.git) PHP · 271 lines

1 <?php

2 namespace librdf\tests\cases;

3

71 {

72 $uri = new URINode($this->testURI);

73 $this->assertTrue(is_resource($uri->getNode()));

74 }

75

Filesystem.php (https://gitlab.com/pthapa81/MeroSaaman-1.0) PHP · 573 lines

1 <?php

2

3 namespace League\Flysystem;

87 public function writeStream($path, $resource, array $config = [])

88 {

89 if (! is_resource($resource)) {

90 throw new InvalidArgumentException(__METHOD__.' expects argument #2 to be a valid resource.');

91 }

200 public function updateStream($path, $resource, array $config = [])

201 {

202 if (! is_resource($resource)) {

203 throw new InvalidArgumentException(__METHOD__.' expects argument #2 to be a valid resource.');

204 }

Stream.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 297 lines

1 <?php

2 /**

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

15

16 /**

17 * Represents an HTTP response message as PHP stream resource

18 */

19 class Stream extends Response

151 public static function fromStream($responseString, $stream)

152 {

153 if (!is_resource($stream) || get_resource_type($stream) !== 'stream') {

154 throw new Exception\InvalidArgumentException('A valid stream is required');

155 }

190 $response = static::fromString($headersString);

191

192 if (is_resource($stream)) {

193 $response->setStream($stream);

194 }

DeepCopy.php (https://gitlab.com/mdabutaleb/bitm-laravel-1) PHP · 243 lines

1 <?php

2

3 namespace DeepCopy;

97

98 // Resource

99 if (is_resource($var)) {

100 return $var;

101 }

Connection.php (https://bitbucket.org/gencer/zf2.git) PHP · 364 lines

1 <?php

2 /**

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

52 if (is_array($connectionInfo)) {

53 $this->setConnectionParameters($connectionInfo);

54 } elseif (is_resource($connectionInfo)) {

55 $this->setResource($connectionInfo);

56 } else {

215 public function isConnected()

216 {

217 return (is_resource($this->resource));

218 }

219

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

1 <?php

2 /**

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

314 }

315

316 if (! is_resource($resource) || 'stream' !== get_resource_type($resource)) {

317 throw new InvalidArgumentException(

318 'Invalid stream provided; must be a string stream identifier or stream resource'

Session.php (https://bitbucket.org/thesyncim/admin-biarq.git) PHP · 306 lines

1 <?php

2 /**

3 * Lithium: the most rad php framework

4 *

5 * @copyright Copyright 2011, Union of RAD (http://union-of-rad.org)

6 * @license http://opensource.org/licenses/bsd-license.php The BSD License

7 */

8

133 $options += $defaults;

134

135 if (is_resource($value) || !static::$_configurations) {

136 return false;

137 }

InputStream.php (https://github.com/makerlabs/Symfohub.git) PHP · 178 lines

1 <?php

2 /*

3 * $Id: FileReader.php 123 2006-09-14 20:19:08Z mrook $

21

22 /**

23 * Wrapper class for PHP stream that supports read operations.

24 *

25 * @package phing.system.io

28

29 /**

30 * @var resource The attached PHP stream.

31 */

32 protected $stream;

44 /**

45 * Construct a new InputStream.

46 * @param resource $stream Configured PHP stream for writing.

47 */

48 public function __construct($stream) {

streams.php (https://gitlab.com/Gashler/sg) PHP · 315 lines

1 <?php

2 /**

3 * Classes, which help reading streams of data from files.

4 * Based on the classes from Danilo Segan <danilo@kvota.net>

5 *

6 * @version $Id: streams.php 718 2012-10-31 00:32:02Z nbachiyski $

7 * @package pomo

8 * @subpackage streams

16

17 /**

18 * PHP5 constructor.

19 */

20 function __construct() {

24

25 /**

26 * PHP4 constructor.

27 */

28 public function POMO_Reader() {

rule_model.php (https://gitlab.com/fredec/ionizecms-1.0.8.x) PHP · 461 lines

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

2 /**

3 * Ionize

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

1 <?php

2 /**

3 * @version $Id$

63 $dumpBuffer = array();

64 $columns = array();

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

66

67 // Append create query to file

MountManager.php (https://gitlab.com/ealexis.t/trends) PHP · 271 lines

1 <?php

2

3 namespace League\Flysystem;

203 $result = call_user_func_array([$fsTo, 'writeStream'], array_merge($arguments, [$buffer, $config]));

204

205 if (is_resource($buffer)) {

206 fclose($buffer);

207 }

ForkingLoop.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 174 lines

1 <?php

2

3 /*

111 * The savegame contains the current execution state, and can be resumed in

112 * the event that the worker dies unexpectedly (for example, by encountering

113 * a PHP fatal error).

114 */

115 private function createSavegame()

158

159 // Resources don't error, but they don't serialize well either.

160 if (is_resource($value) || $value instanceof \Closure) {

161 continue;

162 }

Imagine.php (https://github.com/ndusan/bginfobox.git) PHP · 225 lines

1 <?php

2

3 /*

64

65 /**

66 * (non-PHPdoc)

67 * @see Imagine\Image\ImagineInterface::create()

68 */

110

111 /**

112 * (non-PHPdoc)

113 * @see Imagine\Image\ImagineInterface::open()

114 */

155 $resource = call_user_func('imagecreatefrom'.$format, $path);

156

157 //Active in php development version 5.3, surelly true in 5.4

158 //Inactivate for compatibility

159 if( "gif" === $format and false){

CImageHandler.php (https://bitbucket.org/markmoskalenko/svitor.git) PHP · 591 lines

1 <?php

2 class CImageHandler extends CApplicationComponent

3 {

65 private function freeImage()

66 {

67 if (is_resource($this->image))

68 {

69 imagedestroy($this->image);

73 private function checkLoaded()

74 {

75 if (!is_resource($this->image))

76 {

77 //throw new Exception('Load image first');

TypeLoader.php (https://github.com/praveensingh85/MyEventDashboard1.git) PHP · 231 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: TypeLoader.php 20096 2010-01-06 02:05:09Z bkarwin $

21 */

22

24 * @see Zend_Amf_Value_Messaging_AcknowledgeMessage

25 */

26 require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php';

27 /**

28 * @see Zend_Amf_Value_Messaging_AsyncMessage

29 */

30 require_once 'Zend/Amf/Value/Messaging/AsyncMessage.php';

31 /**

32 * @see Zend_Amf_Value_Messaging_CommandMessage

CurlClient.php (https://github.com/trob/fabrik.git) PHP · 191 lines

1 <?php

2

3

78 \curl_close($curl);

79

80 if (isset($buffer) && \is_resource($buffer)) {

81 \fclose($buffer);

82 }

94 return $this->lastResponse;

95 } catch (\ErrorException $e) {

96 if (isset($curl) && \is_resource($curl)) {

97 \curl_close($curl);

98 }

99

100 if (isset($buffer) && \is_resource($buffer)) {

101 \fclose($buffer);

102 }

Abstract.php (https://gitlab.com/Zipcore/CallAdmin) PHP · 268 lines

1 <?php

2

3 /**

4 * @file

5 * TeamSpeak 3 PHP Framework

6 *

7 * $Id: Abstract.php 3/8/2013 6:00:05 scp@orilla $

240 public function isConnected()

241 {

242 return (is_resource($this->stream)) ? TRUE : FALSE;

243 }

244

Default.php (https://github.com/Martin1982/IBMessagingWorkshopServer.git) PHP · 310 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: Default.php 20096 2010-01-06 02:05:09Z bkarwin $

20 */

21

86 * @see Zend_Ldap_Exception

87 */

88 // require_once 'Zend/Ldap/Exception.php';

89 throw new Zend_Ldap_Exception($this->_ldap, 'counting entries');

90 }

104 {

105 $isClosed = false;

106 if (is_resource($this->_resultId)) {

107 $isClosed = @ldap_free_result($this->_resultId);

108 $this->_resultId = null;

gd.php (https://github.com/redlion09/ems-1.git) PHP · 306 lines

1 <?php

2 /**

3 * Gd Media Adapter File

8 * Redistributions of files must retain the above copyright notice.

9 *

10 * PHP version 5

11 * CakePHP version 1.2

14 * @subpackage media.libs.media.adapter

15 * @copyright 2007-2010 David Persson <davidpersson@gmx.de>

16 * @license http://www.opensource.org/licenses/mit-license.php The MIT License

17 * @link http://github.com/davidpersson/media

18 */

136

137 case 'image/png':

138 if (version_compare(PHP_VERSION, '5.1.2', '>=')) {

139 $this->_compression = (integer)$value;

140 }

text.class.php (https://github.com/konfirm/konsolidate.git) PHP · 272 lines

1 <?php

2

3 /*

133 }

134 }

135 elseif ( !is_resource( $mImage ) )

136 {

137 if ( $sBGColor == "transparent" || $sBGColor == "none" || empty( $sBGColor ) )

215 $nColor = $this->call( "../getColor", $sColor, $rImage );

216 $nBGColor = $this->call( "../getColor", "#000", $rText );

217 if ( !is_resource( $mImage ) )

218 $mImage = &$this->call( "../create", $nNewWidth + $nX, $nNewHeight + $nY, $sBGColor );

219

241 $nWidth = 2 + ( max( $aPoint[ 2 ], $aPoint[ 4 ] ) - min( $aPoint[ 0 ], $aPoint[ 6 ] ) );

242

243 if ( !is_resource( $mImage ) )

244 $mImage = &$this->call( "../create", $nWidth + $nX, $nHeight + $nY, $sBGColor );

245 else

filter.crop.php (https://github.com/symphonycms/jit_image_manipulation.git) PHP · 168 lines

1 <?php

2

3 class FilterCrop extends JIT\ImageFilter

72 imagecopyresampled($tmp, $resource, $src_x, $src_y, $dst_x, $dst_y, $image_width, $image_height, $image_width, $image_height);

73

74 if (is_resource($resource)) {

75 imagedestroy($resource);

76 }

FilesystemAdapter.php (https://gitlab.com/Pasantias/pasantiasASLG) PHP · 353 lines

1 <?php

2

3 namespace Illuminate\Filesystem;

76 }

77

78 if (is_resource($contents)) {

79 return $this->driver->putStream($path, $contents, $config);

80 } else {

120 {

121 if ($this->exists($path)) {

122 return $this->put($path, $data.PHP_EOL.$this->get($path));

123 }

124

136 {

137 if ($this->exists($path)) {

138 return $this->put($path, $this->get($path).PHP_EOL.$data);

139 }

140

Stream.php (https://gitlab.com/endomorphosis/jeffersonsmithmayor) PHP · 238 lines

1 <?php

2

3 /**

17 * @package Microsoft_Http

18 * @subpackage Response

19 * @version $Id: Response.php 17131 2009-07-26 10:03:39Z shahar $

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

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

143 {

144

145 if(is_resource($body)) {

146 $this->setStream($body);

147 $body = '';

212 protected function readStream()

213 {

214 if(!is_resource($this->stream)) {

215 return '';

216 }

BindTest.php (https://github.com/zucchi/zf2.git) PHP · 274 lines

1 <?php

2 /**

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

26 * @group Zend_Ldap

27 */

28 class BindTest extends \PHPUnit_Framework_TestCase

29 {

30 protected $options = null;

269 $ldap = new Ldap\Ldap($this->options);

270 $this->assertNotNull($ldap->getResource());

271 $this->assertTrue(is_resource($ldap->getResource()));

272 $this->assertEquals(TESTS_ZEND_LDAP_USERNAME, $ldap->getBoundUser());

273 }

Debug.php (https://github.com/seloshow/Magento-Pruebas.git) PHP · 189 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 Varien_Debug

23 * @copyright Copyright (c) 2009 Irubin Consulting Inc. DBA Varien (http://www.varien.com)

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

25 */

26

151 $out .= sprintf("&%s#%s#", get_class($arg), spl_object_hash($arg));

152

153 } else if (is_resource($arg)) {

154 $out .= '#[' . get_resource_type($arg) . ']';

155 } else if (is_array($arg)) {

ExternalTransformationsPlugin.class.php (https://bitbucket.org/subhan_12/mwi-panel.git) PHP · 182 lines

1 <?php

2 /* vim: set expandtab sw=4 ts=4 sts=4: */

3 /**

4 * Abstract class for the external transformations plugins

5 *

6 * @package PhpMyAdmin-Transformations

7 * @subpackage External

8 */

9 if (! defined('PHPMYADMIN')) {

10 exit;

11 }

12

13 /* Get the transformations interface */

14 require_once 'libraries/plugins/TransformationsPlugin.class.php';

15

16 /**

PhpArrayDumper.php (https://gitlab.com/leoplanxxi/dr7-web-buap-2016) PHP · 359 lines

1 <?php

2 /**

3 * @file

4 * Contains \Drupal\Core\DependencyInjection\Dumper\PhpArrayDumper

5 */

6

16

17 /**

18 * PhpArrayDumper dumps a service container as a serialized PHP array.

19 */

20 class PhpArrayDumper extends Dumper

29

30 /**

31 * Returns the service container as a PHP array.

32 *

33 * @return array

SocketHandler.php (https://gitlab.com/judielsm/Handora) PHP · 284 lines

18 *

19 * @author Pablo de Leon Belloc <pablolb@gmail.com>

20 * @see http://php.net/manual/en/function.fsockopen.php

21 */

22 class SocketHandler extends AbstractProcessingHandler

93 * @param float $seconds

94 *

95 * @see http://php.net/manual/en/function.fsockopen.php

96 */

97 public function setConnectionTimeout($seconds)

106 * @param float $seconds

107 *

108 * @see http://php.net/manual/en/function.stream-set-timeout.php

109 */

110 public function setTimeout($seconds)

Stream.php (https://bitbucket.org/cviolette/sugarcrm.git) PHP · 246 lines

1 <?php

2

3 /**

140 {

141

142 if(is_resource($body)) {

143 $this->setStream($body);

144 $body = '';

209 protected function readStream()

210 {

211 if(!is_resource($this->stream)) {

212 return '';

213 }

224 public function __destruct()

225 {

226 if(is_resource($this->stream)) {

227 fclose($this->stream);

228 $this->stream = null;

Postgresql.php (https://bitbucket.org/saifshuvo/zf2.git) PHP · 213 lines

1 <?php

2 /**

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

36 if ($driver instanceof Pgsql\Pgsql

37 || ($driver instanceof Pdo\Pdo && $driver->getDatabasePlatformName() == 'Postgresql')

38 || (is_resource($driver) && (in_array(get_resource_type($driver), array('pgsql link', 'pgsql link persistent'))))

39 || ($driver instanceof \PDO && $driver->getAttribute(\PDO::ATTR_DRIVER_NAME) == 'pgsql')

40 ) {

113 $this->resource = $this->resource->getConnection()->getResource();

114 }

115 if (is_resource($this->resource)) {

116 return '\'' . pg_escape_string($this->resource, $value) . '\'';

117 }

139 $this->resource = $this->resource->getConnection()->getResource();

140 }

141 if (is_resource($this->resource)) {

142 return '\'' . pg_escape_string($this->resource, $value) . '\'';

143 }

StreamHandlerTest.php (https://gitlab.com/techniconline/kmc) PHP · 168 lines

1 <?php

2

3 /*

23 public function testWrite()

24 {

25 $handle = fopen('php://memory', 'a+');

26 $handler = new StreamHandler($handle);

27 $handler->setFormatter($this->getIdentityFormatter());

38 public function testClose()

39 {

40 $handle = fopen('php://memory', 'a+');

41 $handler = new StreamHandler($handle);

42 $this->assertTrue(is_resource($handle));

43 $handler->close();

44 $this->assertFalse(is_resource($handle));

45 }

46

streams.php (https://github.com/sharpmachine/wakeupmedia.com.git) PHP · 209 lines

1 <?php

2 /**

3 * Classes, which help reading streams of data from files.

4 * Based on the classes from Danilo Segan <danilo@kvota.net>

5 *

6 * @version $Id: streams.php 597 2011-01-16 20:14:36Z nbachiyski $

7 * @package pomo

8 * @subpackage streams

93 }

94

95 function is_resource() {

96 return true;

97 }

122 }

123

124 function is_resource() {

125 return is_resource($this->_f);

DbMysql.class.php (https://github.com/palmic/2yaml.git) PHP · 238 lines

1 <?php

2

3

8 * @package DbControl

9 * @version 1.5

10 * @license http://opensource.org/licenses/gpl-license.php GNU Public License

11 * @date 2006-01-11

12 */

19 public function DbMysql(DbParametersMessenger $DbParametersMessenger, DbStateHandler $dbStateHandler) {

20 if (!in_array("mysql", get_loaded_extensions())) {

21 throw new DbControlException("Your PHP configuration does not support MySQL extension. Check php.ini.");

22 }

23 $this->dbParametersMessenger = $DbParametersMessenger;

43

44 public function fetchAssoc($result) {

45 if (!is_resource($result)) {

46 throw new DbControlException("Ilegal parameter result. Must be valid result resource.");

47 }

Session.php (https://github.com/mackstar/lithium.git) PHP · 306 lines

1 <?php

2 /**

3 * Lithium: the most rad php framework

4 *

5 * @copyright Copyright 2012, Union of RAD (http://union-of-rad.org)

6 * @license http://opensource.org/licenses/bsd-license.php The BSD License

7 */

8

133 $options += $defaults;

134

135 if (is_resource($value) || !static::$_configurations) {

136 return false;

137 }

dumper.php (https://github.com/hatone/moodle.git) PHP · 360 lines

1 <?php

2 /**

3 * base include file for SimpleTest

4 * @package SimpleTest

5 * @subpackage UnitTester

6 * @version $Id: dumper.php,v 1.4 2010/12/14 17:35:45 moodlerobot Exp $

7 */

8 /**

64 } elseif (is_array($value)) {

65 return "Array";

66 } elseif (is_resource($value)) {

67 return "Resource";

68 } elseif (is_object($value)) {

Frontend.php (https://gitlab.com/LisovyiEvhenii/ismextensions) PHP · 127 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 Varien_Pear

23 * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)

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

25 */

26

43 * Enter description here...

44 *

45 * @param string|resource $stream 'stdout' or open php stream

46 */

47 public function setLogStream($stream)

Frontend.php (https://github.com/rgranadino/magento-mirror.git) PHP · 127 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 Varien_Pear

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

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

25 */

26

43 * Enter description here...

44 *

45 * @param string|resource $stream 'stdout' or open php stream

46 */

47 public function setLogStream($stream)

dumper.php (https://github.com/kennethjiang/Wolke.git) PHP · 360 lines

1 <?php

2 /**

3 * base include file for SimpleTest

4 * @package SimpleTest

5 * @subpackage UnitTester

6 * @version $Id: dumper.php,v 1.29 2006/05/13 14:37:16 lastcraft Exp $

7 */

8 /**

64 } elseif (is_array($value)) {

65 return "Array";

66 } elseif (is_resource($value)) {

67 return "Resource";

68 } elseif (is_object($value)) {

Stream.php (https://gitlab.com/ealexis.t/trends) PHP · 245 lines

1 <?php

2 namespace GuzzleHttp\Psr7;

3

5

6 /**

7 * PHP stream implementation.

8 *

9 * @var $stream

51 public function __construct($stream, $options = [])

52 {

53 if (!is_resource($stream)) {

54 throw new \InvalidArgumentException('Stream must be a resource');

55 }

112 {

113 if (isset($this->stream)) {

114 if (is_resource($this->stream)) {

115 fclose($this->stream);

116 }

Default.php (https://bitbucket.org/Ebozavrik/test-application.git) PHP · 320 lines

1 <?php

2 /**

3 * Zend Framework

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

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

19 * @version $Id: Default.php 24612 2012-01-21 14:42:30Z sgehrig $

20 */

21

87 * @see Zend_Ldap_Exception

88 */

89 require_once 'Zend/Ldap/Exception.php';

90 throw new Zend_Ldap_Exception( $this->_ldap, 'counting entries' );

91 }

105 {

106 $isClosed = false;

107 if (is_resource($this->_resultId)) {

108 $isClosed = @ldap_free_result($this->_resultId);

109 $this->_resultId = null;

ProcessUtils.php (https://gitlab.com/hatemdigify/digifyblog) PHP · 107 lines

1 <?php

2

3 /*

39 public static function escapeArgument($argument)

40 {

41 //Fix for PHP bug #43784 escapeshellarg removes % from given string

42 //Fix for PHP bug #49446 escapeshellarg doesn't work on Windows

43 //@see https://bugs.php.net/bug.php?id=43784

44 //@see https://bugs.php.net/bug.php?id=49446

88 {

89 if (null !== $input) {

90 if (is_resource($input)) {

91 return $input;

92 }

TypeLoader.php (https://github.com/eschabell/openshift-zendframework.git) PHP · 231 lines

1 <?php

2 /**

3 * Zend Framework

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

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

20 * @version $Id: TypeLoader.php 23775 2011-03-01 17:25:24Z ralph $

21 */

22

24 * @see Zend_Amf_Value_Messaging_AcknowledgeMessage

25 */

26 require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php';

27 /**

28 * @see Zend_Amf_Value_Messaging_AsyncMessage

29 */

30 require_once 'Zend/Amf/Value/Messaging/AsyncMessage.php';

31 /**

32 * @see Zend_Amf_Value_Messaging_CommandMessage

Frontend.php (https://bitbucket.org/tschrock52/ethodeshare.git) PHP · 127 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 Varien_Pear

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

43 * Enter description here...

44 *

45 * @param string|resource $stream 'stdout' or open php stream

46 */

47 public function setLogStream($stream)

dumper.php (https://github.com/h-kanjisan/swiftmailer.git) PHP · 359 lines

1 <?php

2 /**

3 * base include file for SimpleTest

4 * @package SimpleTest

5 * @subpackage UnitTester

6 * @version $Id: dumper.php 1782 2008-04-25 17:09:06Z pp11 $

7 */

8 /**

64 } elseif (is_array($value)) {

65 return "Array";

66 } elseif (is_resource($value)) {

67 return "Resource";

68 } elseif (is_object($value)) {

StreamLogger.php (https://github.com/markn86/moodle.git) PHP · 194 lines

1 <?php

2

3 /*

4 * This file is part of Mustache.php.

5 *

6 * (c) 2010-2017 Justin Hileman

17 * this stream.

18 *

19 * Hint: Try `php://stderr` for your stream URL.

20 */

21 class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger

46 $this->setLevel($level);

47

48 if (is_resource($stream)) {

49 $this->stream = $stream;

50 } else {

HttpKernel.php (https://bitbucket.org/laborautonomo/laborautonomo-site.git) PHP · 255 lines

1 <?php

2

3 /*

235 }

236

237 if (is_resource($var)) {

238 return sprintf('Resource(%s)', get_resource_type($var));

239 }

Ftp.php (https://code.google.com/p/celebrio/) PHP · 203 lines

1 <?php

2

3 /**

56 {

57 if (!extension_loaded('ftp')) {

58 throw new \Exception("PHP extension FTP is not loaded.");

59 }

60 }

99 $res = NULL;

100

101 } elseif (!is_resource($this->resource)) {

102 Nette\Tools::catchError($msg);

103 throw new FtpException("Not connected to FTP server. Call connect() or ssl_connect() first.");

AbstractPDOTest.php (https://github.com/fruux/sabre-dav.git) PHP · 373 lines

1 <?php declare (strict_types=1);

2

3 namespace Sabre\CardDAV\Backend;

6 use Sabre\DAV\PropPatch;

7

8 abstract class AbstractPDOTest extends \PHPUnit\Framework\TestCase {

9

10 use \Sabre\DAV\DbTestHelperTrait;

223 ];

224

225 if (is_resource($result['carddata'])) {

226 $result['carddata'] = stream_get_contents($result['carddata']);

227 }

241 $this->assertEquals(2, $result['id']);

242 $this->assertEquals('card2', $result['uri']);

243 if (is_resource($result['carddata'])) {

244 $result['carddata'] = stream_get_contents($result['carddata']);

245 }

TypeLoader.php (https://github.com/basdog22/Qool.git) PHP · 231 lines

1 <?php

2 /**

3 * Zend Framework

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

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

20 * @version $Id: TypeLoader.php 24594 2012-01-05 21:27:01Z matthew $

21 */

22

24 * @see Zend_Amf_Value_Messaging_AcknowledgeMessage

25 */

26 require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php';

27 /**

28 * @see Zend_Amf_Value_Messaging_AsyncMessage

29 */

30 require_once 'Zend/Amf/Value/Messaging/AsyncMessage.php';

31 /**

32 * @see Zend_Amf_Value_Messaging_CommandMessage

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

1 <?php

2

3 namespace SabreForRainLoop\CalDAV\Backend;

144 }

145

146 $data = is_resource($object['calendardata'])?stream_get_contents($object['calendardata']):$object['calendardata'];

147 $vObject = VObject\Reader::read($data);

148

file.php (https://github.com/kamarulismail/kamarul-playground.git) PHP · 509 lines

1 <?php

2 /**

3 * File containing the ezcArchiveFile class.

316 * Touches the specified file (sets the access and modification time).

317 *

318 * PHP system touch doesn't work correctly with the compress.zlib file.

319 *

320 * @param string $fileName

500 public function close()

501 {

502 if ( is_resource( $this->fp ) )

503 {

504 fclose( $this->fp );

StreamHandler.php (https://gitlab.com/judielsm/Handora) PHP · 146 lines

1 <?php

2

3 /*

17 * Stores to any stream resource

18 *

19 * Can be used to store into php://stderr, remote and local files, etc.

20 *

21 * @author Jordi Boggiano <j.boggiano@seld.be>

43 {

44 parent::__construct($level, $bubble);

45 if (is_resource($stream)) {

46 $this->stream = $stream;

47 } elseif (is_string($stream)) {

60 public function close()

61 {

62 if (is_resource($this->stream)) {

63 fclose($this->stream);

64 }

TBGIncomingEmailAccount.class.php (https://github.com/pb30/thebuggenie.git) PHP · 388 lines

1 <?php

2

3 /**

279 $this->_connection = imap_open($this->getConnectionString(), $this->getUsername(), $this->getPassword());

280 }

281 if (!is_resource($this->_connection))

282 {

283 $error = imap_last_error();

test.rst (git://github.com/IronLanguages/main.git) ReStructuredText · 469 lines ✨ Summary

This is a Python module that provides various utility functions for unit testing. It includes functions to capture and check warnings, import modules with specific behaviors, and temporarily set environment variables.

244

245

246 .. function:: is_resource_enabled(resource)

247

248 Return :const:`True` if *resource* is enabled and available. The list of