PageRenderTime 447ms queryTime 45ms sortTime 12ms getByIdsTime 215ms findMatchingLines 113ms

100+ results results for 'php is_resource' (447 ms)

Not the results you expected?
trackback.php https://bitbucket.org/pastor399/newcastleunifc.git | PHP | 372 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * PHP Class to handle TrackBacks (send/ping, receive, retreive, detect, seed, etc...)
                    
4 * 
                    
4 * 
                    
5 * <code><?php
                    
6 * include('trackback_cls.php');
                    
11 * 
                    
12 * @version $Id: trackback_cls.php,v 1.2 2004/12/11 18:54:32 Ran Exp $
                    
13 * @copyright Copyright (c) 2004 Ran Aroussi (http://www.blogish.org)
                    
14 * @author Ran Aroussi <ran@blogish.org> 
                    
15 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
                    
16 * 
                    
77        // Something didn't work out, return
                    
78        if (!is_resource($tb_sock))
                    
79		{
                    
                
cubrid_result.php https://bitbucket.org/saifshuvo/codeigniter.git | PHP | 170 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * An open source application development framework for PHP 5.2.4 or newer
                    
6 *
                    
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))))
                    
168
                    
169/* End of file cubrid_result.php */
                    
170/* Location: ./system/database/drivers/cubrid/cubrid_result.php */
                    
                
Stream.php https://github.com/pborreli/zf2.git | PHP | 151 lines
                    
1<?php
                    
2/**
                    
29     */
                    
30    protected $logSeparator = PHP_EOL;
                    
31
                    
32    /**
                    
33     * Holds the PHP stream to log to.
                    
34     *
                    
65
                    
66        if (is_resource($streamOrUrl)) {
                    
67            if ('stream' != get_resource_type($streamOrUrl)) {
                    
146    {
                    
147        if (is_resource($this->stream)) {
                    
148            fclose($this->stream);
                    
                
class.mysql.php https://github.com/scottkf/nicholscommunications.git | PHP | 429 lines
                    
1<?php
                    
2
                    
92		public function isConnected(){
                    
93	        return (isset($this->_connection['id']) && is_resource($this->_connection['id']));
                    
94	    }
                    
270
                    
271			if(is_resource($this->_result)){
                    
272		        while ($row = mysql_fetch_object($this->_result)){
                    
                
lmbSqliteConnection.class.php https://github.com/knevcher/korchasa_limb.git | PHP | 184 lines
                    
1<?php
                    
2/*
                    
2/*
                    
3 * Limb PHP Framework
                    
4 *
                    
9
                    
10lmb_require('limb/dbal/src/drivers/lmbDbBaseConnection.class.php');
                    
11lmb_require(dirname(__FILE__) . '/lmbSqliteDbInfo.class.php');
                    
11lmb_require(dirname(__FILE__) . '/lmbSqliteDbInfo.class.php');
                    
12lmb_require(dirname(__FILE__) . '/lmbSqliteQueryStatement.class.php');
                    
13lmb_require(dirname(__FILE__) . '/lmbSqliteInsertStatement.class.php');
                    
13lmb_require(dirname(__FILE__) . '/lmbSqliteInsertStatement.class.php');
                    
14lmb_require(dirname(__FILE__) . '/lmbSqliteDropStatement.class.php');
                    
15lmb_require(dirname(__FILE__) . '/lmbSqliteManipulationStatement.class.php');
                    
15lmb_require(dirname(__FILE__) . '/lmbSqliteManipulationStatement.class.php');
                    
16lmb_require(dirname(__FILE__) . '/lmbSqliteStatement.class.php');
                    
17lmb_require(dirname(__FILE__) . '/lmbSqliteTypeInfo.class.php');
                    
                
LoggerAppenderDailyFile.php https://gitlab.com/tomiwa/bcode | PHP | 130 lines
                    
1<?php
                    
2/**
                    
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 *
                    
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 
                    
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
                    
41 * @link http://logging.apache.org/log4php/docs/appenders/daily-file.html Appender documentation
                    
42 */
                    
92			//       any more logging requests
                    
93			if (is_resource($this->fp)) {
                    
94				$this->write($this->layout->getFooter());
                    
                
query.class.php https://github.com/konfirm/konsolidate.git | PHP | 158 lines
                    
1<?php
                    
2
                    
71
                    
72			if ( is_resource( $this->_result ) )
                    
73				$this->rows = sqlite_num_rows( $this->_result );
                    
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 ) );
                    
91		{
                    
92			if ( is_resource( $this->_result ) && sqlite_num_rows( $this->_result ) > 0 )
                    
93				return sqlite_rewind( $this->_result );
                    
106		{
                    
107			if ( is_resource( $this->_result ) )
                    
108				return sqlite_fetch_object( $this->_result );
                    
                
StreamTest.php https://github.com/ibnoe/Microweber.git | PHP | 176 lines
                    
1<?php
                    
2require_once MIO_PATH . 'Stream.php';
                    
2require_once MIO_PATH . 'Stream.php';
                    
3require_once MIO_PATH . 'Exception.php';
                    
4
                    
21    {
                    
22        if( is_resource( $this->server ) ) {
                    
23            fclose( $this->server );
                    
                
SlackHandler.php https://gitlab.com/ealexis.t/trends | PHP | 289 lines
                    
1<?php
                    
2
                    
81     * @param  bool                      $includeContextAndExtra Whether the attachment should include context and extra data
                    
82     * @throws MissingExtensionException If no OpenSSL PHP extension configured
                    
83     */
                    
86        if (!extension_loaded('openssl')) {
                    
87            throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
                    
88        }
                    
244        $res = $this->getResource();
                    
245        if (is_resource($res)) {
                    
246            @fread($res, 2048);
                    
                
file_functions.php https://gitlab.com/protoneutron/xbtbb3cker | PHP | 416 lines
                    
45		{
                    
46			global $phpbb_root_path, $phpEx;
                    
47
                    
49			$common_php_owner = @fileowner($phpbb_root_path . 'common.' . $phpEx);
                    
50			$common_php_group = @filegroup($phpbb_root_path . 'common.' . $phpEx);
                    
51
                    
56			// If we are unable to get owner/group, then do not try to set them by guessing
                    
57			if (!$php_uid || empty($php_gids) || !$common_php_owner || !$common_php_group)
                    
58			{
                    
67					'php_uid'		=> $php_uid,
                    
68					'php_gids'		=> $php_gids,
                    
69				);
                    
92
                    
93		// If the file_uid/gid now match the one from common.php we can process further, else we are not able to change something
                    
94		if ($file_uid != $_chmod_info['common_owner'] || $file_gid != $_chmod_info['common_group'])
                    
                
Config_File.class.php https://github.com/atutor/phpdoc2.git | PHP | 365 lines
                    
1<?php
                    
2
                    
20 * You may contact the author of Config_File by e-mail at:
                    
21 * {@link andrei@php.net}
                    
22 *
                    
23 * The latest version of Config_File can be obtained from:
                    
24 * http://smarty.php.net/
                    
25 *
                    
25 *
                    
26 * @link http://smarty.php.net/
                    
27 * @version 2.6.0
                    
28 * @copyright Copyright: 2001-2003 ispi of Lincoln, Inc.
                    
29 * @author Andrei Zmievski <andrei@php.net>
                    
30 * @access public
                    
33
                    
34/* $Id: Config_File.class.php,v 1.1 2005/10/17 18:37:39 jeichorn Exp $ */
                    
35/**
                    
                
XmlDumper.php https://github.com/Exercise/symfony.git | PHP | 301 lines
                    
1<?php
                    
2
                    
248                }
                    
249                $text = $this->document->createTextNode(self::phpToXml($value));
                    
250                $element->appendChild($text);
                    
279    /**
                    
280     * Converts php types to xml types.
                    
281     *
                    
283     */
                    
284    static public function phpToXml($value)
                    
285    {
                    
294                return '%'.$value.'%';
                    
295            case is_object($value) || is_resource($value):
                    
296                throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');
                    
                
intercept.jdatabasemysql.php https://github.com/Shigaru/shigaru.git | PHP | 342 lines
                    
1<?php
                    
2/**
                    
27 * -----------------------------------------------------------------------------
                    
28 * $Id: intercept.jdatabasemysql.php 1592 2012-01-20 12:51:08Z akede $
                    
29 * @package joomfish
                    
75	function _getFieldCount(){
                    
76		if (!is_resource($this->_cursor)){
                    
77			// This is a serious problem since we do not have a valid db connection
                    
                
adodb-oracle.inc.php https://bitbucket.org/kudutest/moodlegit.git | PHP | 342 lines
                    
1<?php
                    
2/*
                    
101
                    
102        if (is_resource($this->_curs)) $this->_errorMsg = @ora_error($this->_curs);
                    
103 		if (empty($this->_errorMsg)) $this->_errorMsg = @ora_error($this->_connectionID);
                    
111
                    
112		if (is_resource($this->_curs)) $this->_errorCode = @ora_errorcode($this->_curs);
                    
113		if (empty($this->_errorCode)) $this->_errorCode = @ora_errorcode($this->_connectionID);
                    
                
Proxy.php https://bitbucket.org/Dal-Papa/is-340-publish-base.git | PHP | 339 lines
                    
1<?php
                    
2
                    
18 * @subpackage Client_Adapter
                    
19 * @version    $Id: Proxy.php 25261 2013-02-14 12:31:01Z frosch $
                    
20 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
                    
26 */
                    
27require_once 'Zend/Uri/Http.php';
                    
28/**
                    
30 */
                    
31require_once 'Zend/Http/Client.php';
                    
32/**
                    
34 */
                    
35require_once 'Zend/Http/Client/Adapter/Socket.php';
                    
36
                    
135        if (!$this->socket) {
                    
136            require_once 'Zend/Http/Client/Adapter/Exception.php';
                    
137            throw new Zend_Http_Client_Adapter_Exception(
                    
                
Root.php https://gitlab.com/adamlwalker/generatedata | PHP | 467 lines
                    
7// +----------------------------------------------------------------------+
                    
8// | This source file is subject to version 2.02 of the PHP license,      |
                    
9// | that is bundled with this package in the file LICENSE, and is        |
                    
29*/
                    
30class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
                    
31	{
                    
96		$aList = array();
                    
97		PHPExcel_Shared_OLE_PPS::_savePpsSetPnt($aList, array($this));
                    
98		// calculate values for header
                    
112
                    
113		if (!is_resource($filename)) {
                    
114 			fclose($this->_FILEH_);
                    
390		// Calculate Basic Setting
                    
391		$iBbCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE;
                    
392		$i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE;
                    
                
Random.php https://github.com/speedupmate/Magento-CE-Mirror.git | PHP | 274 lines
                    
71            // method 2. openssl_random_pseudo_bytes was introduced in PHP 5.3.0 but prior to PHP 5.3.4 there was,
                    
72            // to quote <http://php.net/ChangeLog-5.php#5.3.4>, "possible blocking behavior". as of 5.3.4
                    
73            // openssl_random_pseudo_bytes and mcrypt_create_iv do the exact same thing on Windows. ie. they both
                    
75            //
                    
76            // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/openssl/openssl.c#L5008
                    
77            // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1392
                    
80            //
                    
81            // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/win32/winutil.c#L80
                    
82            //
                    
102            // method 3. pretty much does the same thing as method 2 per the following url:
                    
103            // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1391
                    
104            // surprisingly slower than method 2. maybe that's because mcrypt_create_iv does a bunch of error checking that we're
                    
110        }
                    
111        // at this point we have no choice but to use a pure-PHP CSPRNG
                    
112
                    
                
FilesystemAdapter.php https://gitlab.com/mdabutaleb/bitm-laravel-1 | PHP | 433 lines
                    
1<?php
                    
2
                    
87
                    
88        if (is_resource($contents)) {
                    
89            return $this->driver->putStream($path, $contents, $config);
                    
122
                    
123        if (is_resource($stream)) {
                    
124            fclose($stream);
                    
164     */
                    
165    public function prepend($path, $data, $separator = PHP_EOL)
                    
166    {
                    
181     */
                    
182    public function append($path, $data, $separator = PHP_EOL)
                    
183    {
                    
                
Ftp.php https://gitlab.com/puntodos/ean-landings | PHP | 448 lines
                    
1<?php
                    
2
                    
186    {
                    
187        $stream = fopen('php://temp', 'w+b');
                    
188        fwrite($stream, $contents);
                    
397    {
                    
398        $stream = fopen('php://temp', 'w+');
                    
399        $result = ftp_fget($this->getConnection(), $stream, $path, $this->transferMode);
                    
445    {
                    
446        return is_resource($this->connection) && ftp_systype($this->connection) !== false;
                    
447    }
                    
                
functions.php https://gitlab.com/reasonat/test8 | PHP | 329 lines
                    
1<?php
                    
2namespace GuzzleHttp;
                    
85{
                    
86    if (is_resource($value)) {
                    
87        return $value;
                    
91
                    
92    return fopen('php://output', 'w');
                    
93}
                    
139        }
                    
140        $defaultAgent .= ' PHP/' . PHP_VERSION;
                    
141    }
                    
295 * @throws \InvalidArgumentException if the JSON cannot be decoded.
                    
296 * @link http://www.php.net/manual/en/function.json-decode.php
                    
297 */
                    
317 * @throws \InvalidArgumentException if the JSON cannot be encoded.
                    
318 * @link http://www.php.net/manual/en/function.json-encode.php
                    
319 */
                    
                
Proxy.php https://bitbucket.org/cviolette/sugarcrm.git | PHP | 284 lines
                    
1<?php
                    
2
                    
26 */
                    
27require_once 'Zend/Uri/Http.php';
                    
28/**
                    
30 */
                    
31require_once 'Zend/Http/Client.php';
                    
32/**
                    
34 */
                    
35require_once 'Zend/Http/Client/Adapter/Socket.php';
                    
36
                    
125        if (! $this->socket) {
                    
126            require_once 'Zend/Http/Client/Adapter/Exception.php';
                    
127            throw new Zend_Http_Client_Adapter_Exception("Trying to write but we are not connected");
                    
133        if ($this->connected_to[0] != "tcp://$host" || $this->connected_to[1] != $port) {
                    
134            require_once 'Zend/Http/Client/Adapter/Exception.php';
                    
135            throw new Zend_Http_Client_Adapter_Exception("Trying to write but we are connected to the wrong proxy server");
                    
                
NetClient.php https://gitlab.com/wuhang2003/rainloop-webmail | PHP | 629 lines
                    
1<?php
                    
2
                    
187	 */
                    
188	public function capturePhpErrorWithException($iErrNo, $sErrStr, $sErrFile, $iErrLine)
                    
189	{
                    
270
                    
271		\set_error_handler(array(&$this, 'capturePhpErrorWithException'));
                    
272
                    
285
                    
286		$this->writeLog('Connected ('.(\is_resource($this->rConnect) ? 'success' : 'unsuccess').')',
                    
287			\MailSo\Log\Enumerations\Type::NOTE);
                    
288
                    
289		if (!\is_resource($this->rConnect))
                    
290		{
                    
312		$bError = true;
                    
313		if (\is_resource($this->rConnect) &&
                    
314			\MailSo\Base\Utils::FunctionExistsAndEnabled('stream_socket_enable_crypto'))
                    
                
Snapshot.php https://gitlab.com/ealexis.t/trends | PHP | 423 lines
                    
1<?php
                    
2/*
                    
4 *
                    
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
                    
6 *
                    
405        if (!is_object($variable)) {
                    
406            return !is_resource($variable);
                    
407        }
                    
                
class_image_gd.php https://gitlab.com/ptisky/API_prestashop | PHP | 375 lines
                    
1<?php

                    
2/**

                    
227

                    
228        if (is_resource($image) && (get_resource_type($image) == "gd")) {

                    
229            $width = @imagesx($image);

                    
                
mysql_driver.php https://gitlab.com/Japang-Jawara/jawara-penilaian | PHP | 516 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * An open source application development framework for PHP
                    
6 *
                    
132
                    
133		// Error suppression is necessary mostly due to PHP 5.5+ issuing E_DEPRECATED messages
                    
134		$this->conn_id = ($persistent === TRUE)
                    
149
                    
150		if (isset($this->stricton) && is_resource($this->conn_id))
                    
151		{
                    
                
CakeSocket.php https://gitlab.com/nghiep5890/bakery | PHP | 464 lines
                    
1<?php
                    
2/**
                    
2/**
                    
3 * CakePHP Socket connection class.
                    
4 *
                    
4 *
                    
5 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
                    
6 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
12 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
13 * @link          http://cakephp.org CakePHP(tm) Project
                    
14 * @package       Cake.Network
                    
14 * @package       Cake.Network
                    
15 * @since         CakePHP(tm) v 1.2.0
                    
16 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
                    
21/**
                    
22 * CakePHP network socket connection class.
                    
23 *
                    
                
index.html https://github.com/connec/yash.git | HTML | 368 lines
                    
13    <script type="text/javascript" src="jquery.yash.js"></script>
                    
14    <script type="text/javascript" src="yash.syntax.php.js"></script>
                    
15    <script type="text/javascript">
                    
21  <body>
                    
22    <div id="editor">&lt;?php
                    
23
                    
24/**
                    
25 * parser.php
                    
26 */
                    
194    
                    
195    if(is_resource($this-&gt;source))
                    
196      rewind($this-&gt;source);
                    
208    
                    
209    if(is_resource($this-&gt;source)) {
                    
210      if($this-&gt;line = rtrim(fgets($this-&gt;source), "\r\n"))
                    
                
WindowsAzure.php https://github.com/necrogami/zf2.git | PHP | 448 lines
                    
1<?php
                    
2/**
                    
55    const RETURN_STRING = 2; // return data as string
                    
56    const RETURN_STREAM = 3; // return PHP stream
                    
57
                    
201
                    
202        if (is_resource($data))    {
                    
203            $temporaryFilePath = tempnam('', 'azr');
                    
                
PhpiredisSocketConnection.php https://gitlab.com/ntphuc/BackendFeedy | PHP | 393 lines
                    
20 * This class provides the implementation of a Predis connection that uses the
                    
21 * PHP socket extension for network communication and wraps the phpiredis C
                    
22 * extension (PHP bindings for hiredis) to parse the Redis protocol.
                    
73    /**
                    
74     * Checks if the socket and phpiredis extensions are loaded in PHP.
                    
75     */
                    
83
                    
84        if (!extension_loaded('phpiredis')) {
                    
85            throw new NotSupportedException(
                    
113    {
                    
114        $reader = phpiredis_reader_create();
                    
115
                    
356
                    
357        while (PHPIREDIS_READER_STATE_INCOMPLETE === $state = phpiredis_reader_get_state($reader)) {
                    
358            if (@socket_recv($socket, $buffer, 4096, 0) === false || $buffer === '' || $buffer === null) {
                    
                
PhpiredisSocketConnection.php https://github.com/otto-torino/gino.git | PHP | 392 lines
                    
20 * This class provides the implementation of a Predis connection that uses the
                    
21 * PHP socket extension for network communication and wraps the phpiredis C
                    
22 * extension (PHP bindings for hiredis) to parse the Redis protocol.
                    
72    /**
                    
73     * Checks if the socket and phpiredis extensions are loaded in PHP.
                    
74     */
                    
82
                    
83        if (!extension_loaded('phpiredis')) {
                    
84            throw new NotSupportedException(
                    
110    {
                    
111        $reader = phpiredis_reader_create();
                    
112
                    
355
                    
356        while (PHPIREDIS_READER_STATE_INCOMPLETE === $state = phpiredis_reader_get_state($reader)) {
                    
357            if (@socket_recv($socket, $buffer, 4096, 0) === false || $buffer === '') {
                    
                
Part.php https://gitlab.com/wuhang2003/rainloop-webmail | PHP | 665 lines
                    
1<?php
                    
2
                    
263		$rStreamHandle = (@file_exists($sFileName)) ? @fopen($sFileName, 'rb') : false;
                    
264		if (is_resource($rStreamHandle))
                    
265		{
                    
267
                    
268			if (is_resource($rStreamHandle))
                    
269			{
                    
285
                    
286		if (is_resource($rStreamHandle))
                    
287		{
                    
616	{
                    
617		if ($this->Body && \is_resource($this->Body))
                    
618		{
                    
652				$rSubPartsStream = $this->SubParts->ToStream($sBoundary);
                    
653				if (is_resource($rSubPartsStream))
                    
654				{
                    
                
Session.php https://github.com/brtriver/sukonv.git | PHP | 300 lines
                    
1<?php
                    
2/**
                    
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 */
                    
138
                    
139		if (is_resource($value) || !static::$_configurations) {
                    
140			return false;
                    
                
Curl.php https://github.com/dmolsen/MIT-Mobile-Web.git | PHP | 392 lines
                    
27/** Zend_Http_Client_Adapter_Interface */
                    
28require_once 'Zend/Http/Client/Adapter/Interface.php';
                    
29
                    
31 * An adapter class for Zend_Http_Client based on the curl extension.
                    
32 * Curl requires libcurl. See for full requirements the PHP manual: http://php.net/curl
                    
33 *
                    
103        if (!extension_loaded('curl')) {
                    
104            require_once 'Zend/Http/Client/Adapter/Exception.php';
                    
105            throw new Zend_Http_Client_Adapter_Exception('cURL extension has to be loaded to use this Zend_Http_Client adapter.');
                    
185
                    
186            require_once 'Zend/Http/Client/Adapter/Exception.php';
                    
187            throw new Zend_Http_Client_Adapter_Exception('Unable to Connect to ' .  $host . ':' . $port);
                    
305         * Make sure POSTFIELDS is set after $curlMethod is set:
                    
306         * @link http://de2.php.net/manual/en/function.curl-setopt.php#81161
                    
307         */
                    
                
dumper.php https://github.com/quarkness/piwik.git | PHP | 360 lines
                    
1<?php
                    
2/**
                    
5 *  @subpackage UnitTester
                    
6 *  @version    $Id: dumper.php 1723 2008-04-08 00:34:10Z lastcraft $
                    
7 */
                    
65            return "Array";
                    
66        } elseif (is_resource($value)) {
                    
67            return "Resource";
                    
                
YamlDumper.php https://gitlab.com/Snizer/PI-DEV-TUNISIAMALL3A6-WEB | PHP | 336 lines
                    
1<?php
                    
2
                    
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.');
                    
                
Calendar.php https://bitbucket.org/freshflow/sabredav-1.8.5-fork.git | PHP | 376 lines
                    
1<?php
                    
2
                    
189
                    
190        if (is_resource($calendarData)) {
                    
191            $calendarData = stream_get_contents($calendarData);
                    
                
Abstract.php https://github.com/adrienne/Readability.git | PHP | 385 lines
                    
1<?php
                    
2
                    
20 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
21 * @version    $Id: Abstract.php 12395 2008-11-07 23:58:38Z nico $
                    
22 */
                    
27 */
                    
28require_once 'Zend/Validate.php';
                    
29
                    
33 */
                    
34require_once 'Zend/Validate/Hostname.php';
                    
35
                    
46 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
47 * @version    $Id: Abstract.php 12395 2008-11-07 23:58:38Z nico $
                    
48 * @todo Implement proxy settings
                    
136             */
                    
137            require_once 'Zend/Mail/Protocol/Exception.php';
                    
138            throw new Zend_Mail_Protocol_Exception(join(', ', $this->_validHost->getMessages()));
                    
                
LDAPClient.class.php https://github.com/treuter/xp-framework.git | PHP | 446 lines
                    
1<?php
                    
2/* This class is part of the XP framework
                    
52   *
                    
53   * @see      php://ldap
                    
54   * @see      http://developer.netscape.com/docs/manuals/directory/41/ag/
                    
159    public function isConnected() {
                    
160      return is_resource($this->_hdl);
                    
161    }
                    
165     *
                    
166     * @see     php://ldap_close
                    
167     * @return  bool success
                    
187     * @throws  peer.ldap.LDAPException
                    
188     * @see     php://ldap_search
                    
189     */
                    
249     * @throws  peer.ldap.LDAPException
                    
250     * @see     php://ldap_search
                    
251     */
                    
                
helper.php https://gitlab.com/wuhang2003/core | PHP | 297 lines
                    
1<?php
                    
2/**
                    
33	/**
                    
34	 * @dataProvider phpFileSizeProvider
                    
35	 */
                    
35	 */
                    
36	public function testPhpFileSize($expected, $input)
                    
37	{
                    
37	{
                    
38		$result = OC_Helper::phpFileSize($input);
                    
39		$this->assertEquals($expected, $result);
                    
41
                    
42	public function phpFileSizeProvider()
                    
43	{
                    
200
                    
201		if (is_resource($source)) {
                    
202			fclose($source);
                    
                
functions.php https://gitlab.com/i-have-a-green/digitemis-v3 | PHP | 334 lines
                    
1<?php
                    
2namespace GuzzleHttp;
                    
85{
                    
86    if (is_resource($value)) {
                    
87        return $value;
                    
91
                    
92    return fopen('php://output', 'w');
                    
93}
                    
139        }
                    
140        $defaultAgent .= ' PHP/' . PHP_VERSION;
                    
141    }
                    
298 * @throws Exception\InvalidArgumentException if the JSON cannot be decoded.
                    
299 * @link http://www.php.net/manual/en/function.json-decode.php
                    
300 */
                    
321 * @throws Exception\InvalidArgumentException if the JSON cannot be encoded.
                    
322 * @link http://www.php.net/manual/en/function.json-encode.php
                    
323 */
                    
                
Ftp.php https://bitbucket.org/ajalovec/gaufrette.git | PHP | 474 lines
                    
1<?php
                    
2
                    
55
                    
56        $temp = fopen('php://temp', 'r+');
                    
57
                    
80
                    
81        $temp = fopen('php://temp', 'r+');
                    
82        $size = fwrite($temp, $content);
                    
382    {
                    
383        return is_resource($this->connection);
                    
384    }
                    
                
sfImageTransformGDAdapter.class.php https://github.com/Feri1972/sfFilebasePlugin.git | PHP | 505 lines
                    
1<?php
                    
2/*
                    
72    {
                    
73      throw new sfImageTransformException('The image processing library GD is not enabled. See PHP Manual for installation instructions.');
                    
74    }
                    
131
                    
132    if (is_resource($resource) && 'gd' === get_resource_type($resource))
                    
133    {
                    
244
                    
245    if (is_resource($resource) && 'gd' === get_resource_type($resource))
                    
246    {
                    
276  {
                    
277    if (is_resource($this->holder) && 'gd' === get_resource_type($this->holder))
                    
278    {
                    
                
Process.php https://github.com/agustinc/SemdropsMobile.git | PHP | 372 lines
                    
1<?php
                    
2
                    
15 * Process is a thin wrapper around proc_* functions to ease
                    
16 * start independent PHP processes.
                    
17 *
                    
51        if (!function_exists('proc_open')) {
                    
52            throw new \RuntimeException('The Process class relies on proc_open, which is not available on your PHP installation.');
                    
53        }
                    
79     *
                    
80     * @param Closure|string|array $callback A PHP callback to run whenever there is some
                    
81     *                                       output available on STDOUT or STDERR
                    
106
                    
107        // Workaround for http://bugs.php.net/bug.php?id=51800
                    
108        if (strstr(PHP_OS, 'WIN')) {
                    
117
                    
118        if (!is_resource($process)) {
                    
119            throw new \RuntimeException('Unable to launch a new process.');
                    
                
Abstract.php https://bitbucket.org/baruffaldi/webapp-urltube.git | PHP | 385 lines
                    
1<?php
                    
2
                    
20 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
21 * @version    $Id: Abstract.php 8064 2008-02-16 10:58:39Z thomas $
                    
22 */
                    
27 */
                    
28require_once 'Zend/Validate.php';
                    
29
                    
33 */
                    
34require_once 'Zend/Validate/Hostname.php';
                    
35
                    
46 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
47 * @version    $Id: Abstract.php 8064 2008-02-16 10:58:39Z thomas $
                    
48 * @todo Implement proxy settings
                    
136             */
                    
137            require_once 'Zend/Mail/Protocol/Exception.php';
                    
138            throw new Zend_Mail_Protocol_Exception(join(', ', $this->_validHost->getMessages()));
                    
                
couchdb_source.php https://github.com/radig/datasources.git | PHP | 375 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * PHP version 5
                    
6 *
                    
6 *
                    
7 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
                    
8 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
13 * @copyright     Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
14 * @link          http://cakephp.org CakePHP(tm) Project
                    
15 * @package       datasources
                    
16 * @subpackage    datasources.models.datasources
                    
17 * @since         CakePHP Datasources v 0.3
                    
18 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
                    
99	public function disconnect() {
                    
100		if (isset($this->results) && is_resource($this->results)) {
                    
101			$this->results = null;
                    
                
yaf_config.c https://gitlab.com/oytunistrator/yaf | C | 405 lines
                    
10  | obtain it through the world-wide-web, please send a note to          |
                    
11  | license@php.net so we can mail you a copy immediately.               |
                    
12  +----------------------------------------------------------------------+
                    
12  +----------------------------------------------------------------------+
                    
13  | Author: Xinchen Hui  <laruence@php.net>                              |
                    
14  +----------------------------------------------------------------------+
                    
23#include "php_ini.h"
                    
24#include "standard/php_filestat.h" /* for php_stat */
                    
25
                    
25
                    
26#include "php_yaf.h"
                    
27#include "yaf_namespace.h"
                    
48	zval  n_ctime;
                    
49	php_stat(Z_STRVAL_P(file), Z_STRLEN_P(file), 7 /* FS_CTIME */ , &n_ctime TSRMLS_CC);
                    
50	if (Z_TYPE(n_ctime) != IS_BOOL && ctime != Z_LVAL(n_ctime)) {
                    
                
Abstract.php https://bitbucket.org/brunoMaurice/youfood.git | PHP | 385 lines
                    
1<?php
                    
2
                    
20 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
21 * @version    $Id: Abstract.php 16219 2009-06-21 19:45:39Z thomas $
                    
22 */
                    
27 */
                    
28require_once 'Zend/Validate.php';
                    
29
                    
33 */
                    
34require_once 'Zend/Validate/Hostname.php';
                    
35
                    
46 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
47 * @version    $Id: Abstract.php 16219 2009-06-21 19:45:39Z thomas $
                    
48 * @todo Implement proxy settings
                    
136             */
                    
137            require_once 'Zend/Mail/Protocol/Exception.php';
                    
138            throw new Zend_Mail_Protocol_Exception(join(', ', $this->_validHost->getMessages()));
                    
                
XmlDumper.php https://github.com/l3l0/BehatExamples.git | PHP | 329 lines
                    
1<?php
                    
2
                    
276                }
                    
277                $text = $this->document->createTextNode(self::phpToXml($value));
                    
278                $element->appendChild($text);
                    
306    /**
                    
307     * Converts php types to xml types.
                    
308     *
                    
311     */
                    
312    static public function phpToXml($value)
                    
313    {
                    
322                return '%'.$value.'%';
                    
323            case is_object($value) || is_resource($value):
                    
324                throw new \RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');
                    
                
common.php https://bitbucket.org/emilhdiaz/webics.git | PHP | 302 lines
                    
1<?php
                    
2require_once('enum.php');
                    
12		
                    
13	include_once("$class.php");
                    
14
                    
265
                    
266   if (!is_resource($process)) return false;
                    
267
                    
                
oracle.php https://github.com/vohnicky/treeview.git | PHP | 420 lines
                    
1<?php
                    
2
                    
7 * @copyright  Copyright (c) 2005, 2010 David Grudl
                    
8 * @license    http://dibiphp.com/license  dibi license
                    
9 * @link       http://dibiphp.com
                    
51		if (!extension_loaded('oci8')) {
                    
52			throw new DibiDriverException("PHP extension 'oci8' is not loaded.");
                    
53		}
                    
113
                    
114		return is_resource($this->resultSet) ? clone $this : NULL;
                    
115	}
                    
                
function.socket-set-option.html https://bitbucket.org/stillzhl/manuals.git | HTML | 167 lines
                    
11 <div class="up"><a href="ref.sockets.html">Socket 函数</a></div>
                    
12 <div class="home"><a href="index.html">PHP Manual</a></div>
                    
13</div><hr /><div id="function.socket-set-option" class="refentry">
                    
15  <h1 class="refname">socket_set_option</h1>
                    
16  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">socket_set_option</span> &mdash; <span class="dc-title">Sets socket options for the socket</span></p>
                    
17
                    
121<div class="phpcode"><code><span style="color: #000000">
                    
122<span style="color: #0000BB">&lt;?php<br />$socket&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">socket_create</span><span style="color: #007700">(</span><span style="color: #0000BB">AF_INET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOCK_STREAM</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOL_TCP</span><span style="color: #007700">);<br /><br />if&nbsp;(!</span><span style="color: #0000BB">is_resource</span><span style="color: #007700">(</span><span style="color: #0000BB">$socket</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'Unable&nbsp;to&nbsp;create&nbsp;socket:&nbsp;'</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">socket_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_last_error</span><span style="color: #007700">())&nbsp;.&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br />}<br /><br />if&nbsp;(!</span><span style="color: #0000BB">socket_set_option</span><span style="color: #007700">(</span><span style="color: #0000BB">$socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOL_SOCKET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SO_REUSEADDR</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'Unable&nbsp;to&nbsp;set&nbsp;option&nbsp;on&nbsp;socket:&nbsp;'</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">socket_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_last_error</span><span style="color: #007700">())&nbsp;.&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br />}<br /><br />if&nbsp;(!</span><span style="color: #0000BB">socket_bind</span><span style="color: #007700">(</span><span style="color: #0000BB">$socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'127.0.0.1'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1223</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'Unable&nbsp;to&nbsp;bind&nbsp;socket:&nbsp;'</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">socket_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_last_error</span><span style="color: #007700">())&nbsp;.&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$rval&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">socket_get_option</span><span style="color: #007700">(</span><span style="color: #0000BB">$socket</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SOL_SOCKET</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">SO_REUSEADDR</span><span style="color: #007700">);<br /><br />if&nbsp;(</span><span style="color: #0000BB">$rval&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'Unable&nbsp;to&nbsp;get&nbsp;socket&nbsp;option:&nbsp;'</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">socket_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_last_error</span><span style="color: #007700">())&nbsp;.&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br />}&nbsp;else&nbsp;if&nbsp;(</span><span style="color: #0000BB">$rval&nbsp;</span><span style="color: #007700">!==&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'SO_REUSEADDR&nbsp;is&nbsp;set&nbsp;on&nbsp;socket&nbsp;!'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
                    
123</span>
                    
165 <div class="up"><a href="ref.sockets.html">Socket 函数</a></div>
                    
166 <div class="home"><a href="index.html">PHP Manual</a></div>
                    
167</div></body></html>
                    
                
Default.php https://gitlab.com/rsilveira1987/Expresso | PHP | 312 lines
                    
1<?php
                    
2/**
                    
87             */
                    
88            require_once 'Zend/Ldap/Exception.php';
                    
89            throw new Zend_Ldap_Exception($this->_ldap, 'counting entries');
                    
105        $isClosed = false;
                    
106        if (is_resource($this->_resultId)) {
                    
107             $isClosed = @ldap_free_result($this->_resultId);
                    
193    {
                    
194        if (!is_resource($this->_current)) {
                    
195            $this->rewind();
                    
196        }
                    
197        if (!is_resource($this->_current)) {
                    
198            return null;
                    
238    {
                    
239        if (!is_resource($this->_current)) {
                    
240            $this->rewind();
                    
                
PharStreamWrapper.php https://gitlab.com/virtualrealms/d7civicrm | PHP | 511 lines
                    
1<?php
                    
2namespace TYPO3\PharStreamWrapper;
                    
19     * Internal stream constants that are not exposed to PHP, but used...
                    
20     * @see https://github.com/php/php-src/blob/e17fc0d73c611ad0207cac8a4a01ded38251a7dc/main/php_streams.h
                    
21     */
                    
43    {
                    
44        if (!is_resource($this->internalResource)) {
                    
45            return false;
                    
51        );
                    
52        return !is_resource($this->internalResource);
                    
53    }
                    
67        );
                    
68        return is_resource($this->internalResource);
                    
69    }
                    
258            $arguments[] = $this->context;
                    
259        // work around https://bugs.php.net/bug.php?id=66569
                    
260        // for including files from Phar stream with OPcache enabled
                    
                
sqlite.php https://github.com/yourhty/hypervm.git | PHP | 635 lines
                    
1<?php
                    
2
                    
195
                    
196	if (!(is_resource($query) || is_object($query))) {
                    
197		return 0;
                    
                
Proxy.php https://github.com/wzs/Scrappr.git | PHP | 268 lines
                    
1<?php
                    
2
                    
18 * @subpackage Client_Adapter
                    
19 * @version    $Id: Proxy.php 9868 2008-07-02 06:47:38Z shahar $
                    
20 * @copyright  Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
                    
23
                    
24require_once 'Zend/Uri/Http.php';
                    
25require_once 'Zend/Http/Client.php';
                    
25require_once 'Zend/Http/Client.php';
                    
26require_once 'Zend/Http/Client/Adapter/Socket.php';
                    
27
                    
88        if (($this->connected_to[0] != $host || $this->connected_to[1] != $port)) {
                    
89            if (is_resource($this->socket)) $this->close();
                    
90        }
                    
92        // Now, if we are not connected, connect
                    
93        if (! is_resource($this->socket) || ! $this->config['keepalive']) {
                    
94            $this->socket = @fsockopen($host, $port, $errno, $errstr, (int) $this->config['timeout']);
                    
                
ext_std_variable.cpp https://github.com/tstarling/hiphop-php.git | C++ | 345 lines
                    
2   +----------------------------------------------------------------------+
                    
3   | HipHop for PHP                                                       |
                    
4   +----------------------------------------------------------------------+
                    
5   | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com)     |
                    
6   | Copyright (c) 1997-2010 The PHP Group                                |
                    
7   +----------------------------------------------------------------------+
                    
7   +----------------------------------------------------------------------+
                    
8   | This source file is subject to version 3.01 of the PHP license,      |
                    
9   | that is bundled with this package in the file LICENSE, and is        |
                    
10   | available through the world-wide-web at the following url:           |
                    
11   | http://www.php.net/license/3_01.txt                                  |
                    
12   | If you did not receive a copy of the PHP license and are unable to   |
                    
13   | obtain it through the world-wide-web, please send a note to          |
                    
14   | license@php.net so we can mail you a copy immediately.               |
                    
15   +----------------------------------------------------------------------+
                    
                
OPS.php https://github.com/axxtel/agilebill.git | PHP | 667 lines
                    
1<?php
                    
2/*
                    
4 *
                    
5 * OpenSRS-PHP
                    
6 *
                    
28 * vim: set expandtab tabstop=4 shiftwidth=4:
                    
29 * $Id: OPS.php,v 1.1 2004/09/30 09:25:23 Tony Exp $
                    
30 *
                    
34
                    
35require_once 'PEAR.php';
                    
36
                    
142
                    
143		/* PHP doesn't have timeout for fread ... we just set the timeout for the socket */
                    
144
                    
224		$return = false;
                    
225		if (is_resource($fh)) {
                    
226			$temp = socket_get_status($fh);
                    
                
Memcacheq.php https://gitlab.com/devtoannh/cafe | PHP | 428 lines
                    
1<?php
                    
2/**
                    
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
20 * @version    $Id: Memcacheq.php 23775 2011-03-01 17:25:24Z ralph $
                    
21 */
                    
25 */
                    
26require_once 'Zend/Queue/Adapter/AdapterAbstract.php';
                    
27
                    
76        if (!extension_loaded('memcache')) {
                    
77            require_once 'Zend/Queue/Exception.php';
                    
78            throw new Zend_Queue_Exception('Memcache extension does not appear to be loaded');
                    
96        if ($result === false) {
                    
97            require_once 'Zend/Queue/Exception.php';
                    
98            throw new Zend_Queue_Exception('Could not connect to MemcacheQ');
                    
114        }
                    
115        if (is_resource($this->_socket)) {
                    
116            $cmd = 'quit' . self::EOL;
                    
                
sfYamlInline.php https://github.com/Fil/textwheel.git | PHP | 421 lines
                    
1<?php
                    
2
                    
16 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
                    
17 * @version    SVN: $Id: sfYamlInline.class.php 16177 2009-03-11 08:32:48Z fabien $
                    
18 */
                    
21  /**
                    
22   * Convert a YAML string to a PHP array.
                    
23   *
                    
25   *
                    
26   * @return array A PHP array representing the YAML string
                    
27   */
                    
48  /**
                    
49   * Dumps a given PHP variable to a YAML string.
                    
50   *
                    
50   *
                    
51   * @param mixed $value The PHP variable to convert
                    
52   *
                    
                
directftp.php https://github.com/Ratmir15/Joomla---formula-of-success.git | PHP | 331 lines
                    
1<?php
                    
2/**
                    
119		// Are we connected to a server?
                    
120		if(!is_resource($this->_ftphandle))
                    
121		{
                    
165	 * "Magic" function called just before serialization of the object. Disconnects
                    
166	 * from the FTP server and allows PHP to serialize like normal.
                    
167	 * @return array The variables to serialize
                    
170	{
                    
171		if(is_resource($this->_ftphandle))
                    
172		{
                    
205
                    
206		if(!is_resource($this->_ftphandle))
                    
207		{
                    
                
SocketHandler.php https://gitlab.com/Anas7232/Layout-Changes | PHP | 379 lines
                    
19 * @author Pablo de Leon Belloc <pablolb@gmail.com>
                    
20 * @see    http://php.net/manual/en/function.fsockopen.php
                    
21 */
                    
100     *
                    
101     * @see http://php.net/manual/en/function.fsockopen.php
                    
102     */
                    
113     *
                    
114     * @see http://php.net/manual/en/function.stream-set-timeout.php
                    
115     */
                    
226     *
                    
227     * @see http://php.net/manual/en/function.stream-set-timeout.php
                    
228     */
                    
239     *
                    
240     * @see http://php.net/manual/en/function.stream-set-chunk-size.php
                    
241     */
                    
                
streams.php https://github.com/muskmelon/Greemo.git | PHP | 209 lines
                    
1<?php
                    
2/**
                    
5 *
                    
6 * @version $Id: streams.php 406 2010-02-07 11:10:24Z nbachiyski $
                    
7 * @package pomo
                    
94
                    
95	function is_resource() {
                    
96		return true;
                    
123
                    
124	function is_resource() {
                    
125		return is_resource($this->_f);
                    
                
Session_files_driver.php https://gitlab.com/gundambison/secure | PHP | 363 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * An open source application development framework for PHP
                    
6 *
                    
124		{
                    
125			throw new Exception("Session: Configured save path '".$this->_config['save_path']."' is not writable by the PHP process.");
                    
126		}
                    
147	{
                    
148		// This might seem weird, but PHP 5.6 introduces session_reset(),
                    
149		// which re-reads session data
                    
152			// Just using fopen() with 'c+b' mode would be perfect, but it is only
                    
153			// available since PHP 5.2.6 and we have to set permissions for new files,
                    
154			// so we'd have to hack around this ...
                    
226
                    
227		if ( ! is_resource($this->_file_handle))
                    
228		{
                    
                
postgre.php https://github.com/premiumcombination/nts.git | PHP | 584 lines
                    
1<?php
                    
2
                    
51		if (!extension_loaded('pgsql')) {
                    
52			throw new DibiNotSupportedException("PHP extension 'pgsql' is not loaded.");
                    
53		}
                    
91
                    
92		if (!is_resource($this->connection)) {
                    
93			throw new DibiDriverException('Connecting error.');
                    
107
                    
108		$this->escMethod = version_compare(PHP_VERSION , '5.2.0', '>=');
                    
109	}
                    
137
                    
138		} elseif (is_resource($res)) {
                    
139			$this->affectedRows = pg_affected_rows($res);
                    
436	{
                    
437		$hasTable = version_compare(PHP_VERSION , '5.2.0', '>=');
                    
438		$count = pg_num_fields($this->resultSet);
                    
                
Default.php https://bitbucket.org/acidel/buykoala.git | PHP | 310 lines
                    
1<?php
                    
2/**
                    
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 */
                    
87             */
                    
88            #require_once 'Zend/Ldap/Exception.php';
                    
89            throw new Zend_Ldap_Exception($this->_ldap, 'counting entries');
                    
105        $isClosed = false;
                    
106        if (is_resource($this->_resultId)) {
                    
107             $isClosed = @ldap_free_result($this->_resultId);
                    
193    {
                    
194        if (!is_resource($this->_current)) {
                    
195            $this->rewind();
                    
196        }
                    
197        if (!is_resource($this->_current)) {
                    
198            return null;
                    
                
PhpStreamRequestFactory.php https://gitlab.com/treighton/wpgit | PHP | 284 lines
                    
1<?php
                    
2
                    
11/**
                    
12 * Factory used to create fopen streams using PHP's http and https stream wrappers
                    
13 *
                    
13 *
                    
14 * Note: PHP's http stream wrapper only supports streaming downloads. It does not support streaming uploads.
                    
15 */
                    
15 */
                    
16class PhpStreamRequestFactory implements StreamRequestFactoryInterface
                    
17{
                    
32     *
                    
33     * The $params array can contain the following custom keys specific to the PhpStreamRequestFactory:
                    
34     * - stream_class: The name of a class to create instead of a Guzzle\Stream\Stream object
                    
37    {
                    
38        if (is_resource($context)) {
                    
39            $this->contextOptions = stream_context_get_options($context);
                    
                
FlattenException.php https://github.com/AJenbo/ubuntudanmark.dk.git | PHP | 321 lines
                    
1<?php
                    
2
                    
16/**
                    
17 * FlattenException wraps a PHP Exception to be able to serialize it.
                    
18 *
                    
57/**
                    
58 * FlattenException wraps a PHP Exception to be able to serialize it.
                    
59 *
                    
222                foreach ($trace as $i => $frame) {
                    
223                    //  XDebug pre 2.1.1 doesn't currently set the call type key http://bugs.xdebug.org/view.php?id=695
                    
224                    if (!isset($frame['type'])) {
                    
301                $result[$key] = array('boolean', $value);
                    
302            } elseif (is_resource($value)) {
                    
303                $result[$key] = array('resource', get_resource_type($value));
                    
303                $result[$key] = array('resource', get_resource_type($value));
                    
304            } elseif ($value instanceof \__PHP_Incomplete_Class) {
                    
305                // Special case of object, is_object will return false
                    
                
file_handling_over_ftp.php https://github.com/bermi/akelos.git | PHP | 291 lines
                    
1<?php
                    
2
                    
7    if(!function_exists('ftp_connect')){
                    
8        echo "PHP is not compiled with FTP support\n";
                    
9        return;
                    
21
                    
22require_once(dirname(__FILE__).'/../config.php');
                    
23
                    
116        $this->assertTrue($connection);
                    
117        $this->assertTrue(is_resource($connection) && get_resource_type($connection) == 'FTP Buffer');
                    
118        $this->assertIdentical($connection, AkFtp::connect());
                    
                
dumper.php https://github.com/syfisher/limb.git | PHP | 360 lines
                    
1<?php
                    
2/**
                    
5 *  @subpackage UnitTester
                    
6 *  @version    $Id: dumper.php 7198 2008-11-01 11:57:17Z korchasa $
                    
7 */
                    
65            return "Array";
                    
66        } elseif (is_resource($value)) {
                    
67            return "Resource";
                    
                
Abstract.php https://github.com/quarkness/piwik.git | PHP | 447 lines
                    
1<?php
                    
2
                    
20 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
21 * @version    $Id: Abstract.php 23775 2011-03-01 17:25:24Z ralph $
                    
22 */
                    
27 */
                    
28// require_once 'Zend/Validate.php';
                    
29
                    
33 */
                    
34// require_once 'Zend/Validate/Hostname.php';
                    
35
                    
46 * @license    http://framework.zend.com/license/new-bsd     New BSD License
                    
47 * @version    $Id: Abstract.php 23775 2011-03-01 17:25:24Z ralph $
                    
48 * @todo Implement proxy settings
                    
143             */
                    
144            // require_once 'Zend/Mail/Protocol/Exception.php';
                    
145            throw new Zend_Mail_Protocol_Exception(join(', ', $this->_validHost->getMessages()));
                    
                
class-zip.php https://gitlab.com/endomorphosis/falkenstein | PHP | 306 lines
                    
1<?php
                    
2
                    
83
                    
84			if (!is_resource($process)) {
                    
85				$updraftplus->log('BinZip error: proc_open failed');
                    
217	public function open($path, $flags = 0) {
                    
218		if(!class_exists('PclZip')) include_once(ABSPATH.'/wp-admin/includes/class-pclzip.php');
                    
219		if(!class_exists('PclZip')) {
                    
                
Serializer.php https://github.com/iulianmanole/dcms.git | PHP | 342 lines
                    
1<?php
                    
2/**
                    
22/** Zend_Amf_Parse_Serializer */
                    
23require_once 'Zend/Amf/Parse/Serializer.php';
                    
24
                    
25/** Zend_Amf_Parse_TypeLoader */
                    
26require_once 'Zend/Amf/Parse/TypeLoader.php';
                    
27
                    
28/**
                    
29 * Detect PHP object type and convert it to a corresponding AMF3 object type
                    
30 *
                    
38    /**
                    
39     * Serialize PHP types to AMF3 and write to stream
                    
40     *
                    
42     * auto negotiates the type or use the user defined markerType to
                    
43     * serialize the data from php back to AMF3
                    
44     *
                    
                
class.database.php https://github.com/yeargin/photo-vote-php.git | PHP | 309 lines
                    
1<?PHP
                    
2    class Database
                    
33        {
                    
34            /* If loading througha  config.php file */
                    
35            $this->readHost      = DB_READ_HOST;
                    
44
                    
45            /* If using Simple-PHP-Framework's config class ... */
                    
46            // $this->readHost      = Config::get('dbReadHost');
                    
71        {
                    
72            return is_resource($this->readDB) && get_resource_type($this->readDB) == 'mysql link';
                    
73        }
                    
77        {
                    
78            return is_resource($this->writeDB) && get_resource_type($this->writeDB) == 'mysql link';
                    
79        }
                    
85            $result = mysql_list_tables($this->name, $this->readDB);
                    
86            return is_resource($result);
                    
87        }
                    
                
Serializer.php https://gitlab.com/yousafsyed/easternglamor | PHP | 362 lines
                    
1<?php
                    
2/**
                    
23/** Zend_Amf_Constants */
                    
24#require_once 'Zend/Amf/Constants.php';
                    
25
                    
26/** @see Zend_Amf_Parse_Serializer */
                    
27#require_once 'Zend/Amf/Parse/Serializer.php';
                    
28
                    
29/**
                    
30 * Serializer PHP misc types back to there corresponding AMF0 Type Marker.
                    
31 *
                    
65    {
                    
66        // Workaround for PHP5 with E_STRICT enabled complaining about "Only
                    
67        // variables should be passed by reference"
                    
114                    default:
                    
115                        #require_once 'Zend/Amf/Exception.php';
                    
116                        throw new Zend_Amf_Exception("Unknown Type Marker: " . $markerType);
                    
                
mysqli.php https://github.com/CCI-Studios/Wee-Magazine.git | PHP | 365 lines
                    
1<?php
                    
2/**
                    
3 * Akeeba Engine
                    
4 * The modular PHP5 site backup engine
                    
5 * @copyright Copyright (c)2009-2012 Nicholas K. Dionysopoulos
                    
120		$return = false;
                    
121		if (is_resource($this->cursor)) {
                    
122			mysqli_free_result($this->cursor);
                    
                
ServerCommand.php https://gitlab.com/mohamed_hussein/prodt | PHP | 277 lines
                    
16use Symfony\Component\Process\PhpExecutableFinder;
                    
17use Symfony\Component\Process\PhpProcess;
                    
18use Symfony\Component\Process\Process;
                    
119      $connection = @fsockopen($host, $port);
                    
120      if (is_resource($connection)) {
                    
121        // Port is being used.
                    
141  protected function openBrowser($url, SymfonyStyle $io) {
                    
142    $is_windows = defined('PHP_WINDOWS_VERSION_BUILD');
                    
143    if ($is_windows) {
                    
173    // to start up the PHP built-in webserver in the meantime. We use a
                    
174    // PhpProcess so that Windows powershell users also get a browser opened
                    
175    // for them.
                    
175    // for them.
                    
176    $php = "<?php sleep(2); passthru(\"$cmd\"); ?>";
                    
177    $process = new PhpProcess($php);
                    
                
image.php https://gitlab.com/valced/anchor-cms | PHP | 258 lines
                    
1<?php
                    
2
                    
69
                    
70		if(is_resource($this->dst_image)) {
                    
71			$res = $this->dst_image;
                    
93
                    
94		if(is_resource($this->dst_image)) {
                    
95			$res = $this->dst_image;
                    
117
                    
118		if(is_resource($this->dst_image)) {
                    
119			$res = $this->dst_image;
                    
                
StreamHandlerTest.php https://gitlab.com/Pasantias/pasantiasASLG | PHP | 184 lines
                    
1<?php
                    
2
                    
24    {
                    
25        $handle = fopen('php://memory', 'a+');
                    
26        $handler = new StreamHandler($handle);
                    
39    {
                    
40        $handle = fopen('php://memory', 'a+');
                    
41        $handler = new StreamHandler($handle);
                    
41        $handler = new StreamHandler($handle);
                    
42        $this->assertTrue(is_resource($handle));
                    
43        $handler->close();
                    
43        $handler->close();
                    
44        $this->assertTrue(is_resource($handle));
                    
45    }
                    
51    {
                    
52        $handler = new StreamHandler('php://memory');
                    
53        $handler->handle($this->getRecord(Logger::WARNING, 'test'));
                    
                
GifCreator.php https://gitlab.com/billyprice1/mc-skintools | PHP | 349 lines
                    
1<?php
                    
2
                    
9     * @author    Sybio (Clément Guillemain  / @Sybio01)
                    
10     * @license   http://opensource.org/licenses/gpl-license.php GNU Public License
                    
11     * @copyright Clément Guillemain
                    
94
                    
95                if (is_resource($frames[$i])) { // Resource var
                    
96
                    
                
Abstract.php https://github.com/tanduy/zf.git | PHP | 411 lines
                    
1<?php
                    
2
                    
27 */
                    
28require_once 'Zend/Validate.php';
                    
29
                    
33 */
                    
34require_once 'Zend/Validate/Hostname.php';
                    
35
                    
141             */
                    
142            require_once 'Zend/Mail/Protocol/Exception.php';
                    
143            throw new Zend_Mail_Protocol_Exception(join(', ', $this->_validHost->getMessages()));
                    
251             */
                    
252            require_once 'Zend/Mail/Protocol/Exception.php';
                    
253            throw new Zend_Mail_Protocol_Exception($errorStr);
                    
259             */
                    
260            require_once 'Zend/Mail/Protocol/Exception.php';
                    
261            throw new Zend_Mail_Protocol_Exception('Could not set stream timeout');
                    
                
dbo_mysqli.php https://github.com/cgajardo/repositorium.git | PHP | 332 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * PHP versions 4 and 5
                    
6 *
                    
6 *
                    
7 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
                    
8 * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
                    
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.model.datasources.dbo
                    
17 * @since         CakePHP(tm) v 1.1.4.2974
                    
18 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
                    
24 *
                    
25 * Provides connection and SQL generation for MySQL RDMS using PHP's MySQLi Interface
                    
26 *
                    
                
BodyTest.php https://gitlab.com/leon0399/damnit-engine | PHP | 401 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * @link      https://github.com/slimphp/Slim
                    
6 * @copyright Copyright (c) 2011-2015 Josh Lockhart
                    
6 * @copyright Copyright (c) 2011-2015 Josh Lockhart
                    
7 * @license   https://github.com/slimphp/Slim/blob/master/LICENSE.md (MIT License)
                    
8 */
                    
13
                    
14class BodyTest extends \PHPUnit_Framework_TestCase
                    
15{
                    
26    {
                    
27        if (is_resource($this->stream) === true) {
                    
28            fclose($this->stream);
                    
42    {
                    
43        $stream = fopen('php://temp', $mode);
                    
44        fwrite($stream, $this->text);
                    
                
class_gd.php https://github.com/mydesignivan/guerraguerrero.git | PHP | 381 lines
                    
1<?php
                    
2
                    
9  * @copyright 2010 KCFinder Project
                    
10  *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
                    
11  *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
                    
49
                    
50        } elseif (is_resource($image) && (get_resource_type($image) == "gd")) {
                    
51            $width = imagesx($image);
                    
69        $return = (
                    
70            is_resource($image) &&
                    
71            (get_resource_type($image) == "gd") &&
                    
                
Root.php https://gitlab.com/albert925/lading-ach | PHP | 453 lines
                    
7// +----------------------------------------------------------------------+
                    
8// | This source file is subject to version 2.02 of the PHP license,      |
                    
9// | that is bundled with this package in the file LICENSE, and is        |
                    
10// | available at through the world-wide-web at                           |
                    
11// | http://www.php.net/license/2_02.txt.                                 |
                    
12// | If you did not receive a copy of the PHP license and are unable to   |
                    
19//
                    
20// $Id: Root.php,v 1.9 2005/04/23 21:53:49 dufuz Exp $
                    
21
                    
29*/
                    
30class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
                    
31	{
                    
101
                    
102		if (!is_resource($filename)) {
                    
103 			fclose($this->_FILEH_);
                    
                
SocketHandlerTest.php https://github.com/nattaphat/hgis.git | PHP | 283 lines
                    
1<?php
                    
2
                    
224        $this->handler->close();
                    
225        $this->assertFalse(is_resource($this->res), "Expected resource to be closed after closing handler");
                    
226    }
                    
232        $this->writeRecord('Hello world');
                    
233        $this->assertTrue(is_resource($this->res));
                    
234        $this->handler->close();
                    
234        $this->handler->close();
                    
235        $this->assertTrue(is_resource($this->res));
                    
236    }
                    
250    {
                    
251        $this->res = fopen('php://memory', 'a');
                    
252
                    
                
Default.php https://gitlab.com/devtoannh/cafe | PHP | 310 lines
                    
1<?php
                    
2/**
                    
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 */
                    
87             */
                    
88            require_once 'Zend/Ldap/Exception.php';
                    
89            throw new Zend_Ldap_Exception($this->_ldap, 'counting entries');
                    
105        $isClosed = false;
                    
106        if (is_resource($this->_resultId)) {
                    
107             $isClosed = @ldap_free_result($this->_resultId);
                    
193    {
                    
194        if (!is_resource($this->_current)) {
                    
195            $this->rewind();
                    
196        }
                    
197        if (!is_resource($this->_current)) {
                    
198            return null;
                    
                
mysql_driver.php https://github.com/katzgrau/notes.git | PHP | 638 lines
                    
1<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
                    
2/**
                    
4 *
                    
5 * An open source application development framework for PHP 4.3.2 or newer
                    
6 *
                    
272
                    
273		if (function_exists('mysql_real_escape_string') AND is_resource($this->conn_id))
                    
274		{
                    
636
                    
637/* End of file mysql_driver.php */
                    
638/* Location: ./system/database/drivers/mysql/mysql_driver.php */
                    
                
mo.php https://gitlab.com/VTTE/sitios-vtte | PHP | 349 lines
                    
1<?php
                    
2/**
                    
4 *
                    
5 * @version $Id: mo.php 1157 2015-11-20 04:30:11Z dd32 $
                    
6 * @package pomo
                    
9
                    
10require_once __DIR__ . '/translations.php';
                    
11require_once __DIR__ . '/streams.php';
                    
42
                    
43			if ( ! $reader->is_resource() ) {
                    
44				return false;
                    
69		function export() {
                    
70			$tmp_fh = fopen( 'php://temp', 'r+' );
                    
71			if ( ! $tmp_fh ) {
                    
198
                    
199			// bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565
                    
200			$magic_little    = (int) - 1794895138;
                    
                
Abstract.php https://gitlab.com/Ltaimao/wecenter | PHP | 451 lines
                    
1<?php
                    
2
                    
27 */
                    
28//require_once 'Zend/Validate.php';
                    
29
                    
33 */
                    
34//require_once 'Zend/Validate/Hostname.php';
                    
35
                    
143             */
                    
144            //require_once 'Zend/Mail/Protocol/Exception.php';
                    
145            throw new Zend_Mail_Protocol_Exception(join(', ', $this->_validHost->getMessages()));
                    
279             */
                    
280            //require_once 'Zend/Mail/Protocol/Exception.php';
                    
281            throw new Zend_Mail_Protocol_Exception($errorStr);
                    
287             */
                    
288            //require_once 'Zend/Mail/Protocol/Exception.php';
                    
289            throw new Zend_Mail_Protocol_Exception('Could not set stream timeout');
                    
                
FilesystemAdapter.php https://gitlab.com/Sigpot/AirSpot | PHP | 383 lines
                    
1<?php
                    
2
                    
80
                    
81        if (is_resource($contents)) {
                    
82            return $this->driver->putStream($path, $contents, $config);
                    
121     */
                    
122    public function prepend($path, $data, $separator = PHP_EOL)
                    
123    {
                    
137     */
                    
138    public function append($path, $data, $separator = PHP_EOL)
                    
139    {
                    
                
Serializer.php https://bitbucket.org/kudutest1/moodlegit.git | PHP | 362 lines
                    
1<?php
                    
2/**
                    
23/** Zend_Amf_Constants */
                    
24require_once 'Zend/Amf/Constants.php';
                    
25
                    
26/** @see Zend_Amf_Parse_Serializer */
                    
27require_once 'Zend/Amf/Parse/Serializer.php';
                    
28
                    
29/**
                    
30 * Serializer PHP misc types back to there corresponding AMF0 Type Marker.
                    
31 *
                    
65    {
                    
66        // Workaround for PHP5 with E_STRICT enabled complaining about "Only 
                    
67        // variables should be passed by reference" 
                    
114                    default:
                    
115                        require_once 'Zend/Amf/Exception.php';
                    
116                        throw new Zend_Amf_Exception("Unknown Type Marker: " . $markerType);
                    
                
StreamWrapper.php https://github.com/FabienD/symfony.git | PHP | 302 lines
                    
1<?php
                    
2
                    
18/**
                    
19 * Allows turning ResponseInterface instances to PHP streams.
                    
20 *
                    
43    /**
                    
44     * Creates a PHP stream resource from a ResponseInterface.
                    
45     *
                    
121    {
                    
122        if (\is_resource($this->content)) {
                    
123            // Empty the internal activity list
                    
216    {
                    
217        if (!\is_resource($this->content) || 0 !== fseek($this->content, 0, \SEEK_END)) {
                    
218            return false;
                    
                
File.php https://gitlab.com/Ltaimao/wecenter | PHP | 198 lines
                    
1<?php
                    
2/**
                    
23/** Zend_Pdf_FileParserDataSource */
                    
24//require_once 'Zend/Pdf/FileParserDataSource.php';
                    
25
                    
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",
                    
82        if (! is_readable($filePath)) {
                    
83            //require_once 'Zend/Pdf/Exception.php';
                    
84            throw new Zend_Pdf_Exception("File is not readable: $filePath",
                    
87        if (($this->_size = @filesize($filePath)) === false) {
                    
88            //require_once 'Zend/Pdf/Exception.php';
                    
89            throw new Zend_Pdf_Exception("Error while obtaining file size: $filePath",
                    
92        if (($this->_fileResource = @fopen($filePath, 'rb')) === false) {
                    
93            //require_once 'Zend/Pdf/Exception.php';
                    
94            throw new Zend_Pdf_Exception("Cannot open file for reading: $filePath",
                    
                
textreplacebuddy.php https://bitbucket.org/anneivycat/california-tour.git | PHP | 318 lines
                    
7 *	Text replacements using command line if available. There is no good way to do text replacements
                    
8 *	on a large scale in PHP efficiently.
                    
9 *
                    
70			// Handle Windows wanting .exe.
                    
71			if ( stristr( PHP_OS, 'WIN' ) && !stristr( PHP_OS, 'DARWIN' ) ) { // Running Windows. (not darwin)
                    
72				return array( 'php' ); // Nothing good in Windows available to text replace.
                    
88				pb_backupbuddy::status( 'details', 'textreplace test: Command appears to be accessible and returns expected response.' );
                    
89				return array( 'commandline', 'php' ); // mysqldump best, php next.
                    
90			}
                    
97		
                    
98		return array( 'php' );
                    
99		
                    
182		// Handle Windows wanting .exe.
                    
183		if ( stristr( PHP_OS, 'WIN' ) && !stristr( PHP_OS, 'DARWIN' ) ) { // Running Windows. (not darwin)
                    
184			return false;
                    
                
LoggerDataCollector.php https://gitlab.com/milton2913/myBlog | PHP | 213 lines
                    
1<?php
                    
2
                    
165
                    
166        if (is_resource($context)) {
                    
167            return sprintf('Resource(%s)', get_resource_type($context));
                    
                
Filesystem.php https://gitlab.com/puleeno/fiona-fashion | PHP | 400 lines
                    
1<?php
                    
2
                    
75    {
                    
76        if ( ! is_resource($resource)) {
                    
77            throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.');
                    
108    {
                    
109        if ( ! is_resource($resource)) {
                    
110            throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.');
                    
159    {
                    
160        if ( ! is_resource($resource)) {
                    
161            throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.');
                    
                
QuestionHelper.php https://gitlab.com/I-NOZex/quiz | PHP | 449 lines
                    
1<?php
                    
2
                    
78    {
                    
79        if (!is_resource($stream)) {
                    
80            throw new InvalidArgumentException('Input stream must be a valid resource.');
                    
106     *
                    
107     * This method is public for PHP 5.3 compatibility, it should be private.
                    
108     *
                    
                
AbstractProtocol.php https://bitbucket.org/saifshuvo/zf2.git | PHP | 356 lines
                    
1<?php
                    
2/**
                    
241    {
                    
242        if (is_resource($this->socket)) {
                    
243            fclose($this->socket);
                    
256    {
                    
257        if (!is_resource($this->socket)) {
                    
258            throw new Exception\RuntimeException('No connection has been established to ' . $this->host);
                    
284    {
                    
285        if (!is_resource($this->socket)) {
                    
286            throw new Exception\RuntimeException('No connection has been established to ' . $this->host);
                    
                
Process.php https://bitbucket.org/hanutimes/hanutimes.git | PHP | 379 lines
                    
1<?php
                    
2
                    
30 * Process is a thin wrapper around proc_* functions to ease
                    
31 * start independent PHP processes.
                    
32 *
                    
66        if (!function_exists('proc_open')) {
                    
67            throw new \RuntimeException('The Process class relies on proc_open, which is not available on your PHP installation.');
                    
68        }
                    
94     *
                    
95     * @param Closure|string|array $callback A PHP callback to run whenever there is some
                    
96     *                                       output available on STDOUT or STDERR
                    
124
                    
125        if (!is_resource($process)) {
                    
126            throw new \RuntimeException('Unable to launch a new process.');
                    
                
YamlDumper.php https://github.com/nguyennamtien/TaskBoxx.git | PHP | 266 lines
                    
1<?php
                    
2
                    
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.');
                    
                
DoMysql.php https://github.com/Doap/FrogCMS.git | PHP | 428 lines
                    
1<?php
                    
2
                    
42 * For more specification on methods of this class check the PDO class
                    
43 * can be find on the same directory at DoLite.php
                    
44 *
                    
202    {
                    
203        if (!is_resource($this->_connection)) {
                    
204            $errno = mysql_errno();
                    
221 * For more specification on methods of this class check the PDO class
                    
222 * can be find on the same directory at PDO.php
                    
223 *
                    
406    {
                    
407        if ( ! is_resource($this->_connection)) {
                    
408            $errno = mysql_errno();
                    
                
FileRepository_Backend_MySQL.class.php https://github.com/cj/Project-Pier.git | PHP | 443 lines
                    
1<?php
                    
2
                    
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');
                    
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');
                    
                
 

Source

Language