100+ results for 'php extension_loaded'
Not the results you expected?
XML.php (https://bitbucket.org/stager94/skmz-joomla.git) PHP · 377 lines
1 <?php
3 /**
4 * XML-parsing classes to wrap the domxml and DOM extensions for PHP 4
5 * and 5, respectively.
6 *
13 /**
14 * The base class for wrappers for available PHP XML-parsing
15 * extensions. To work with this Yadis library, subclasses of this
16 * class MUST implement the API as defined in the remarks for this
17 * class. Subclasses of Auth_Yadis_XMLParser are used to wrap
18 * particular PHP XML extensions such as 'domxml'. These are used
19 * internally by the library depending on the availability of
20 * supported PHP XML extensions.
AtoumTask.php (https://github.com/agallou/atoum.git) PHP · 459 lines
1 <?php
3 use
10 if (defined('mageekguy\atoum\phing\task\path') === false)
11 {
12 define('mageekguy\atoum\phing\task\path', 'phing/Task.php');
13 }
130 if ($this->phpPath !== null)
131 {
132 $this->runner->setPhpPath($this->phpPath);
133 }
300 }
302 public function setPhpPath($phpPath)
303 {
304 $this->phpPath = (string) $phpPath;
PlatformJobQueue.php (https://github.com/Exercise/zf2.git) PHP · 318 lines
1 <?php
2 /**
3 * Zend Framework
61 parent::__construct($options, $queue);
63 if (!extension_loaded("jobqueue_client")) {
64 throw new Queue\Exception('Platform Job Queue extension does not appear to be loaded');
65 }
186 $zendApiJob = new $classname($message);
188 // Unfortunately, the Platform JQ API is PHP4-style...
189 $platformJob = $zendApiJob->getJob();
charset_conversion.lib.php (https://github.com/shafiqissani/ASTRA-College-Website.git) PHP · 325 lines
1 <?php
2 /* $Id: charset_conversion.lib.php 8629 2006-02-22 08:26:32Z nijel $ */
18 if ($cfg['RecodingEngine'] == 'recode') {
19 if (!@extension_loaded('recode')) {
20 PMA_dl('recode');
21 if (!@extension_loaded('recode')) {
26 $PMA_recoding_engine = 'recode';
27 } elseif ($cfg['RecodingEngine'] == 'iconv') {
28 if (!@extension_loaded('iconv')) {
29 PMA_dl('iconv');
30 if (!@extension_loaded('iconv')) {
35 $PMA_recoding_engine = 'iconv';
36 } else {
37 if (@extension_loaded('iconv')) {
38 $PMA_recoding_engine = 'iconv';
39 } elseif (@extension_loaded('recode')) {
AllTests.php (https://bitbucket.org/dbaltas/zend-framework-1.x-on-git.git) PHP · 264 lines
1 <?php
2 /**
3 * Zend Framework
21 */
23 if (!defined('PHPUnit_MAIN_METHOD')) {
24 define('PHPUnit_MAIN_METHOD', 'Zend_Cache_AllTests::main');
25 }
27 require_once 'Zend/Cache/ApcBackendTest.php';
28 require_once 'Zend/Cache/ClassFrontendTest.php';
29 require_once 'Zend/Cache/CoreTest.php';
30 require_once 'Zend/Cache/FactoryTest.php';
31 require_once 'Zend/Cache/FileBackendTest.php';
32 require_once 'Zend/Cache/FileFrontendTest.php';
AdapterTest.php (https://github.com/zmicier/zf2.git) PHP · 301 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
14 use Zend\Db\Adapter\Profiler;
16 class AdapterTest extends \PHPUnit_Framework_TestCase
17 {
18 /**
19 * @var \PHPUnit_Framework_MockObject_MockObject
20 */
21 protected $mockDriver = null;
23 /**
24 * @var \PHPUnit_Framework_MockObject_MockObject
25 */
26 protected $mockPlatform = null;
Diff.php (https://github.com/akelos/v1.git) PHP · 371 lines
1 <?php
2 /**
3 * Text_Diff
6 * two sequences of strings.
7 *
8 * The PHP diff code used in this package was originally written by Geoffrey
9 * T. Dairiki and is used with his permission.
10 *
11 * $Horde: framework/Text_Diff/Diff.php,v 1.17 2006/02/06 00:16:09 jan Exp $
12 *
13 * @package Text_Diff
40 if ($engine == 'auto') {
41 $engine = extension_loaded('xdiff') ? 'xdiff' : 'native';
42 }
43 $engine = basename($engine);
MultiTerm.php (https://bitbucket.org/volatileeight/prado.git) PHP · 437 lines
1 <?php
2 /**
3 * Zend Framework
22 /** Zend_Search_Lucene_Search_Query */
23 require_once 'Zend/Search/Lucene/Search/Query.php';
25 /** Zend_Search_Lucene_Search_Weight_MultiTerm */
26 require_once 'Zend/Search/Lucene/Search/Weight/MultiTerm.php';
214 private function _calculateConjunctionResult($reader)
215 {
216 if (extension_loaded('bitset')) {
217 foreach( $this->_terms as $termId=>$term ) {
218 if($this->_resVector === null) {
FactoryTest.php (https://github.com/nbcutech/o3drupal.git) PHP · 381 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: FactoryTest.php 23775 2011-03-01 17:25:24Z ralph $
21 */
23 require_once 'Zend/Barcode.php';
24 require_once 'Zend/Config.php';
32 * @license http://framework.zend.com/license/new-bsd New BSD License
33 */
34 class Zend_Barcode_FactoryTest extends PHPUnit_Framework_TestCase
35 {
ZipTest.php (https://github.com/zucchi/zf2.git) PHP · 287 lines
SimpleStatic.php (https://github.com/koala-framework/koala-framework.git) PHP · 197 lines
61 static $prefix;
62 static $extensionLoaded;
63 if (!isset($extensionLoaded)) $extensionLoaded = extension_loaded('apc');
64 if ($extensionLoaded && PHP_SAPI != 'cli') {
120 public static function clear($cacheIdPrefix)
121 {
122 if (!extension_loaded('apc') || PHP_SAPI == 'cli') {
123 self::$_cache = array();
124 //don't use $cacheIdPrefix as filenames are base64 encoded
138 if ($it->getTotalCount() && !$it->current()) {
139 //APCIterator is borked, delete everything
140 //see https://bugs.php.net/bug.php?id=59938
141 if (extension_loaded('apcu')) {
163 $ret = true;
164 if (!extension_loaded('apc') || PHP_SAPI == 'cli') {
165 foreach ($cacheIds as $cacheId) {
166 unset(self::$_cache[$cacheId]);
collator_test.php (https://github.com/vadimonus/moodle.git) PHP · 333 lines
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
19 *
20 * @package core
21 * @category phpunit
22 * @copyright 2011 Sam Hemelryk
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
30 *
31 * @package core
32 * @category phpunit
33 * @copyright 2011 Sam Hemelryk
34 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
55 }
56 $SESSION->lang = 'en'; // Make sure we test en language to get consistent results, hopefully all systems have this locale.
57 if (extension_loaded('intl')) {
58 $this->error = 'Collation aware sorting not supported';
59 } else {
FactoryTest.php (https://bitbucket.org/ksekar/campus.git) PHP · 381 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: FactoryTest.php 24594 2012-01-05 21:27:01Z matthew $
21 */
23 require_once 'Zend/Barcode.php';
24 require_once 'Zend/Config.php';
32 * @license http://framework.zend.com/license/new-bsd New BSD License
33 */
34 class Zend_Barcode_FactoryTest extends PHPUnit_Framework_TestCase
35 {
FactoryTest.php (https://bitbucket.org/dbaltas/zend-framework-1.x-on-git.git) PHP · 381 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: FactoryTest.php 24593 2012-01-05 20:35:02Z matthew $
21 */
23 require_once 'Zend/Barcode.php';
24 require_once 'Zend/Config.php';
32 * @license http://framework.zend.com/license/new-bsd New BSD License
33 */
34 class Zend_Barcode_FactoryTest extends PHPUnit_Framework_TestCase
35 {
CacheMemcache.php (https://gitlab.com/staging06/myproject) PHP · 265 lines
1 <?php
2 /*
3 * 2007-2015 PrestaShop
8 * that is bundled with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://opensource.org/licenses/osl-3.0.php
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
21 * @author PrestaShop SA <contact@prestashop.com>
22 * @copyright 2007-2015 PrestaShop SA
23 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24 * International Registered Trademark & Property of PrestaShop SA
25 */
56 public function connect()
57 {
58 if (class_exists('Memcache') && extension_loaded('memcache'))
59 $this->memcache = new Memcache();
60 else
Autoloader.php (https://github.com/akelos/akelos.git) PHP · 208 lines
1 <?php
2 // /* vim: set expandtab tabstop=4 shiftwidth=4: */
3 // +----------------------------------------------------------------------+
4 // | PHP Version 5 |
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997-2004 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 3.0 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_0.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
settings.php (https://github.com/sarriaroman/PuntoUBP.git) PHP · 147 lines
random.php (https://github.com/pjwiseman/joomla-cms.git) PHP · 137 lines
2 /**
3 * Random_* Compatibility Library
4 * for using the new PHP 7 random_* API in PHP 5 projects
5 *
6 * The MIT License (MIT)
29 if (!defined('PHP_VERSION_ID')) {
30 // This constant was introduced in PHP 5.2.7
31 $RandomCompatversion = explode('.', PHP_VERSION);
77 // See random_bytes_dev_urandom.php
78 require_once $RandomCompatDIR.'/random_bytes_dev_urandom.php';
79 }
80 if (
81 !function_exists('random_bytes') &&
82 PHP_VERSION_ID >= 50307 &&
83 extension_loaded('mcrypt')
Box.php (https://github.com/zendframework/ZF2Package.git) PHP · 410 lines
McryptTest.php (https://github.com/Exercise/zf2.git) PHP · 241 lines
1 <?php
2 /**
3 * Zend Framework
33 * @group Zend_Filter
34 */
35 class McryptTest extends \PHPUnit_Framework_TestCase
36 {
37 public function setUp()
38 {
39 if (!extension_loaded('mcrypt')) {
40 $this->markTestSkipped('This adapter needs the mcrypt extension');
41 }
225 public function testEncryptionWithDecryptionAndCompressionMcrypt()
226 {
227 if (!extension_loaded('bz2')) {
228 $this->markTestSkipped('This adapter needs the bz2 extension');
229 }
ArchiveDownloaderTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 118 lines
1 <?php
3 /*
13 namespace Composer\Test\Downloader;
15 class ArchiveDownloaderTest extends \PHPUnit_Framework_TestCase
16 {
17 public function testGetFileName()
34 public function testProcessUrl()
35 {
36 if (!extension_loaded('openssl')) {
37 $this->markTestSkipped('Requires openssl');
38 }
50 public function testProcessUrl2()
51 {
52 if (!extension_loaded('openssl')) {
53 $this->markTestSkipped('Requires openssl');
54 }
Scrypt.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 340 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
34 throw new Exception\InvalidArgumentException("N must be > 0 and a power of 2");
35 }
36 if ($n > PHP_INT_MAX / 128 / $r) {
37 throw new Exception\InvalidArgumentException("Parameter n is too large");
38 }
39 if ($r > PHP_INT_MAX / 128 / $p) {
40 throw new Exception\InvalidArgumentException("Parameter r is too large");
41 }
43 if (extension_loaded('Scrypt')) {
44 if ($length < 16) {
45 throw new Exception\InvalidArgumentException("Key length is too low, must be greater or equal to 16");
OfflineTest.php (https://github.com/zucchi/zf2.git) PHP · 131 lines
CacheMemcache.php (https://gitlab.com/A.Julien/sendstockbymail-module-prestashop) PHP · 265 lines
1 <?php
2 /*
3 * 2007-2016 PrestaShop
8 * that is bundled with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://opensource.org/licenses/osl-3.0.php
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
21 * @author PrestaShop SA <contact@prestashop.com>
22 * @copyright 2007-2016 PrestaShop SA
23 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24 * International Registered Trademark & Property of PrestaShop SA
25 */
56 public function connect()
57 {
58 if (class_exists('Memcache') && extension_loaded('memcache'))
59 $this->memcache = new Memcache();
60 else
extension.cache.dbm.php (https://github.com/kennethjiang/Wolke.git) PHP · 217 lines
1 <?php
2 // +----------------------------------------------------------------------+
3 // | PHP version 5 |
15 // | Allan Hansen <ahØartemis*dk> |
16 // +----------------------------------------------------------------------+
17 // | extension.cache.mysql.php |
18 // | MySQL Cache Extension. |
19 // | dependencies: getid3. |
20 // +----------------------------------------------------------------------+
21 //
22 // $Id: extension.cache.dbm.php,v 1.2 2006/11/02 10:47:59 ah Exp $
27 * way as the getID3 class, but return cached information very fast
28 *
29 * Example: (see also demo.cache.dbm.php in /demo/)
30 *
31 * Normal getID3 usage (example):
extprofile_options.h (https://github.com/babannasd/hiphop-php.git) C Header · 295 lines
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
6 | Copyright (c) 1997-2010 The PHP Group |
7 +----------------------------------------------------------------------+
8 | This source file is subject to version 3.01 of the PHP license, |
9 | that is bundled with this package in the file LICENSE, and is |
10 | available through the world-wide-web at the following url: |
11 | http://www.php.net/license/3_01.txt |
12 | If you did not receive a copy of the PHP license and are unable to |
13 | obtain it through the world-wide-web, please send a note to |
14 | license@php.net so we can mail you a copy immediately. |
15 +----------------------------------------------------------------------+
16 */
currency.php (https://bitbucket.org/deringer/opencart.git) PHP · 150 lines
Parser.php (https://bitbucket.org/ke2083/transfans.co.uk-website.git) PHP · 178 lines
1 <?php
3 /*
4 * @package s9e\TextFormatter
5 * @copyright Copyright (c) 2010-2017 The s9e Authors
6 * @license http://www.opensource.org/licenses/mit-license.php The MIT License
7 */
8 namespace s9e\TextFormatter\Plugins\MediaEmbed;
163 {
164 $cacheFile = $cacheDir . '/http.' . \crc32($url);
165 if (\extension_loaded('zlib'))
166 {
167 $prefix = 'compress.zlib://';
171 return \file_get_contents($prefix . $cacheFile);
172 }
173 $content = @self::getHttpClient()->get($url, ['User-Agent: PHP (not Mozilla)']);
174 if (isset($cacheFile) && !empty($content))
175 \file_put_contents($prefix . $cacheFile, $content);
charset_conversion.lib.php (https://github.com/jackygrahamez/DrugDiscovery-Home.git) PHP · 238 lines
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Charset conversion functions.
5 *
6 * @version $Id: charset_conversion.lib.php 11982 2008-11-24 10:32:56Z nijel $
7 * @package phpMyAdmin
8 */
9 if (! defined('PHPMYADMIN')) {
10 exit;
11 }
19 if ($cfg['RecodingEngine'] == 'recode') {
20 if (!@extension_loaded('recode')) {
21 echo $strCantLoadRecodeIconv;
22 exit;
features.php (https://github.com/TheDgtl/customisation-db.git) PHP · 365 lines
1 <?php
2 /**
3 * File containing the ezcBaseFeatures class.
14 * Example:
15 * <code>
16 * <?php
17 * echo "supports uid: " . ezcBaseFeatures::supportsUserId() . "\n";
18 * echo "supports symlink: " . ezcBaseFeatures::supportsSymLink() . "\n";
170 return extension_loaded( $extension );
171 }
172 return extension_loaded( $extension ) && version_compare( phpversion( $extension ), $version, ">=" ) ;
173 }
218 /**
219 * Returns the operating system on which PHP is running.
220 *
221 * This method returns a sanitized form of the OS name, example
gzip.php (https://github.com/chdemko/joomla-cms.git) PHP · 193 lines
Pdo.php (https://bitbucket.org/saifshuvo/zf2.git) PHP · 309 lines
WincacheStorage.php (https://github.com/joomla/joomla-cms.git) PHP · 208 lines
1 <?php
2 /**
3 * Joomla! Content Management System
16 * WinCache cache storage handler
17 *
18 * @link https://www.php.net/manual/en/book.wincache.php
19 * @since 1.7.0
20 * @deprecated 5.0 WinCache is abandoned and not supported from PHP 8 onwards
204 public static function isSupported()
205 {
206 return \extension_loaded('wincache') && \function_exists('wincache_ucache_get') && !strcmp(ini_get('wincache.ucenabled'), '1');
207 }
208 }
WddxTest.php (https://github.com/zucchi/zf2.git) PHP · 236 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
20 * @group Zend_Serializer
21 */
22 class WddxTest extends \PHPUnit_Framework_TestCase
23 {
24 /**
29 public function setUp()
30 {
31 if (!extension_loaded('wddx')) {
32 try {
33 new Serializer\Adapter\Wddx();
111 $expected = '<wddxPacket version=\'1.0\'><header/>'
112 . '<data><struct>'
113 . '<var name=\'php_class_name\'><string>stdClass</string></var>'
114 . '<var name=\'test\'><string>test</string></var>'
115 . '</struct></data></wddxPacket>';
Openssl.php (https://github.com/Martin1982/IBMessagingWorkshopServer.git) PHP · 353 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Openssl.php 20288 2010-01-14 20:15:43Z thomas $
20 */
23 * @see Zend_Filter_Encrypt_Interface
24 */
25 // require_once 'Zend/Filter/Encrypt/Interface.php';
27 /**
68 public function __construct($options = array())
69 {
70 if (!extension_loaded('openssl')) {
71 // require_once 'Zend/Filter/Exception.php';
Rsa.php (https://github.com/ftaiolivista/Zend-Framework-Namespaced-.git) PHP · 329 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: Rsa.php 23439 2010-11-23 21:10:14Z alexander $
21 */
29 * @see Zend_Crypt_Rsa_Key_Private
30 */
31 require_once 'Zend/Crypt/Rsa/Key/Private.php';
33 /**
34 * @see Zend_Crypt_Rsa_Key_Public
35 */
36 require_once 'Zend/Crypt/Rsa/Key/Public.php';
38 /**
charset_conversion.lib.php (https://gitlab.com/albert925/lading-ach) PHP · 238 lines
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 *
6 * @version $Id$
7 * @package phpMyAdmin
8 */
9 if (! defined('PHPMYADMIN')) {
19 if ($cfg['RecodingEngine'] == 'recode') {
20 if (!@extension_loaded('recode')) {
21 echo $strCantLoadRecodeIconv;
22 exit;
24 $PMA_recoding_engine = 'recode';
25 } elseif ($cfg['RecodingEngine'] == 'iconv') {
26 if (!@extension_loaded('iconv')) {
27 echo $strCantLoadRecodeIconv;
28 exit;
Braintree.php (https://github.com/jeremykendall/braintree_php.git) PHP · 153 lines
1 <?php
2 /**
3 * Braintree base class and initialization
4 *
5 * PHP version 5
6 *
7 * @copyright 2010 Braintree Payment Solutions
13 /**
14 * Braintree PHP Library
15 *
16 * Provides methods to child classes. This class cannot be instantiated.
76 }
77 }
78 require_once('Braintree/Modification.php');
79 require_once('Braintree/Instance.php');
ArtifactRepository.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 150 lines
Sqlsrv.php (https://github.com/christeredvartsen/zf2.git) PHP · 189 lines
Default.php (https://github.com/traffman/Omeka.git) PHP · 133 lines
1 <?php
2 /**
3 * @version $Id$
116 Omeka_Validate_File_Extension::WHITELIST_OPTION => Omeka_Validate_File_Extension::DEFAULT_WHITELIST,
117 Omeka_Validate_File_MimeType::WHITELIST_OPTION => Omeka_Validate_File_MimeType::DEFAULT_WHITELIST,
118 File::DISABLE_DEFAULT_VALIDATION_OPTION => (string)!extension_loaded('fileinfo'),
119 Omeka_Db_Migration_Manager::VERSION_OPTION_NAME => OMEKA_VERSION,
120 'display_system_info' => true,
ZipTest.php (https://github.com/Shreef/zf2.git) PHP · 307 lines
1 <?php
2 /**
3 * Zend Framework
32 * @license http://framework.zend.com/license/new-bsd New BSD License
33 */
34 class ZipTest extends \PHPUnit_Framework_TestCase
35 {
36 public function setUp()
37 {
38 if (!extension_loaded('zip')) {
39 $this->markTestSkipped('This adapter needs the zip extension');
40 }
EncryptTest.php (https://bitbucket.org/Dal-Papa/is-340-publish-base.git) PHP · 137 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: EncryptTest.php 24593 2012-01-05 20:35:02Z matthew $
21 */
24 * @see Zend_Filter_Encrypt
25 */
26 require_once 'Zend/Filter/File/Encrypt.php';
27 require_once 'Zend/Filter/File/Decrypt.php';
35 * @group Zend_Filter
36 */
37 class Zend_Filter_File_EncryptTest extends PHPUnit_Framework_TestCase
38 {
39 public function setUp()
PlatformJobQueue.php (https://bitbucket.org/Ebozavrik/test-application.git) PHP · 354 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: PlatformJobQueue.php 24593 2012-01-05 20:35:02Z matthew $
21 */
24 * @see Zend_Queue_Adapter_AdapterAbstract
25 */
26 require_once 'Zend/Queue/Adapter/AdapterAbstract.php';
28 /**
54 parent::__construct($options, $queue);
56 if (!extension_loaded("jobqueue_client")) {
57 require_once 'Zend/Queue/Exception.php';
SlackHandlerTest.php (https://gitlab.com/ealexis.t/trends) PHP · 133 lines
1 <?php
3 /*
33 public function setUp()
34 {
35 if (!extension_loaded('openssl')) {
36 $this->markTestSkipped('This test requires openssl to run');
37 }
108 {
109 $constructorArgs = array($token, $channel, $username, $useAttachment, $iconEmoji, Logger::DEBUG, true, $useShortAttachment, $includeExtra);
110 $this->res = fopen('php://memory', 'a');
111 $this->handler = $this->getMock(
112 '\Monolog\Handler\SlackHandler',
response.php (https://github.com/katalystsol/joomla-platform.git) PHP · 333 lines
commontypes.php (https://github.com/christeredvartsen/zf2.git) PHP · 636 lines
sqlsrv.php (https://github.com/ichraffsnicht/ClanSphere-Enhanced.git) PHP · 270 lines
StreamContextFactoryTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 240 lines
1 <?php
3 /*
15 use Composer\Util\StreamContextFactory;
17 class StreamContextFactoryTest extends \PHPUnit_Framework_TestCase
18 {
19 protected function setUp()
147 )
148 );
149 if (version_compare(PHP_VERSION, '5.6.0', '>=')) {
150 unset($expected['ssl']['SNI_server_name']);
151 }
155 public function testHttpsProxyOverride()
156 {
157 if (!extension_loaded('openssl')) {
158 $this->markTestSkipped('Requires openssl');
159 }
users_create.php (https://github.com/ichraffsnicht/ClanSphere-Enhanced.git) PHP · 173 lines
1 <?php
2 // ClanSphere 2010 - www.clansphere.net
3 // $Id$
12 $data = array();
14 require_once('mods/gallery/functions.php');
16 $cs_option = cs_sql_option(__FILE__,'gallery');
93 $error .= $cs_lang['too_many_f'] . cs_html_br(1);
94 }
95 if(extension_loaded('gd') AND !empty($gray)) {
96 require_once('mods/gallery/gd_2.php');
99 if(empty($error) AND cs_upload('usersgallery/pics', $filename, $files_gl['picture']['tmp_name']) OR !empty($error) AND extension_loaded('gd') AND cs_resample($files_gl['picture']['tmp_name'], 'uploads/usersgallery/pics/' . $filename, $cs_option['width'], $cs_option['height']))
100 {
101 if(empty($error) AND !extension_loaded('gd') AND cs_upload('usersgallery/thumbs', 'Thumb_' . $filename, $files_gl['picture_thumb']['tmp_name']) OR empty($error) AND extension_loaded('gd') AND cs_resample('uploads/usersgallery/pics/' . $filename, 'uploads/usersgallery/thumbs/' . 'Thumb_' . $filename, $cs_option['thumbs'], $cs_option['thumbs']) OR !empty($error) AND extension_loaded('gd') AND cs_resample('uploads/usersgallery/pics/' . $filename, 'uploads/usersgallery/thumbs/' . 'Thumb_' . $filename, $cs_option['thumbs'], $cs_option['thumbs']))
102 {
103 } else {
Course.class.php (https://bitbucket.org/hanutimes/hanutimes.git) PHP · 347 lines
1 <?php
2 /* For licensing terms, see /license.txt */
4 require_once 'LinkCategory.class.php';
5 require_once 'Announcement.class.php';
6 require_once 'Event.class.php';
8 /**
328 */
329 public static function serialize($course) {
330 if (extension_loaded('igbinary')) {
331 return igbinary_serialize($course);
332 } else {
Gd.php (https://gitlab.com/szlongshu/manaphp) PHP · 268 lines
1 <?php
2 namespace ManaPHP\Image\Adapter {
4 use ManaPHP\Image\AdapterInterface;
6 class Gd implements AdapterInterface
33 * @param string $file
34 *
35 * @throws \ManaPHP\Image\Adapter\Exception
36 */
37 public function __construct($file)
38 {
39 if (!extension_loaded('gd')) {
40 throw new Exception('gd is not installed, or the extension is not loaded');
41 }
charset_conversion.lib.php (https://github.com/md-tech/openemr.git) PHP · 326 lines
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
6 * @version $Id$
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
10 }
19 if ($cfg['RecodingEngine'] == 'recode') {
20 if (!@extension_loaded('recode')) {
21 PMA_dl('recode');
22 if (!@extension_loaded('recode')) {
27 $PMA_recoding_engine = 'recode';
28 } elseif ($cfg['RecodingEngine'] == 'iconv') {
29 if (!@extension_loaded('iconv')) {
30 PMA_dl('iconv');
31 if (!@extension_loaded('iconv')) {
IsCompressedTest.php (https://github.com/adaykin/zf2.git) PHP · 189 lines
1 <?php
2 /**
3 * Zend Framework
40 * @group Zend_Validator
41 */
42 class IsCompressedTest extends \PHPUnit_Framework_TestCase
43 {
44 /**
49 public function testBasic()
50 {
51 if (!extension_loaded('fileinfo') &&
52 function_exists('mime_content_type') && ini_get('mime_magic.magicfile') &&
53 (mime_content_type(__DIR__ . '/_files/test.zip') == 'text/plain')
54 ) {
55 $this->markTestSkipped('This PHP Version has no finfo, has mime_content_type, '
56 . ' but mime_content_type exhibits buggy behavior on this system.'
57 );
XMLParser.php (https://bitbucket.org/valmy/openx.git) PHP · 261 lines
9 * http://www.php.net/license/3_0.txt. If you did not receive a copy of
10 * the PHP License and are unable to obtain it through the web, please
11 * send a note to license@php.net so we can mail you a copy immediately.
17 * @copyright 1997-2006 The PHP Group
18 * @license http://www.php.net/license/3_0.txt PHP License 3.0
19 * @version CVS: $Id$
20 * @link http://pear.php.net/package/PEAR
26 * @category pear
27 * @package PEAR
28 * @author Greg Beaver <cellog@php.net>
29 * @author Stephan Schmidt (original XML_Unserializer code)
30 * @copyright 1997-2006 The PHP Group
31 * @license http://www.php.net/license/3_0.txt PHP License 3.0
32 * @version Release: 1.5.4
33 * @link http://pear.php.net/package/PEAR
EncryptTest.php (https://github.com/nbcutech/o3drupal.git) PHP · 137 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: EncryptTest.php 23775 2011-03-01 17:25:24Z ralph $
21 */
24 * @see Zend_Filter_Encrypt
25 */
26 require_once 'Zend/Filter/File/Encrypt.php';
27 require_once 'Zend/Filter/File/Decrypt.php';
35 * @group Zend_Filter
36 */
37 class Zend_Filter_File_EncryptTest extends PHPUnit_Framework_TestCase
38 {
39 public function setUp()
EncryptTest.php (https://bitbucket.org/ksekar/campus.git) PHP · 137 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: EncryptTest.php 24594 2012-01-05 21:27:01Z matthew $
21 */
24 * @see Zend_Filter_Encrypt
25 */
26 require_once 'Zend/Filter/File/Encrypt.php';
27 require_once 'Zend/Filter/File/Decrypt.php';
35 * @group Zend_Filter
36 */
37 class Zend_Filter_File_EncryptTest extends PHPUnit_Framework_TestCase
38 {
39 public function setUp()
PhpConfigDataCollector.php (https://gitlab.com/andecode/theme-spark) PHP · 163 lines
22 $this->data = [
23 'token' => $response->headers->get('X-Debug-Token'),
24 'php_version' => PHP_VERSION,
25 'xdebug_enabled' => extension_loaded('xdebug'),
26 'xhprof_enabled' => extension_loaded('xhprof'),
27 'eaccel_enabled' => extension_loaded('eaccelerator') && ini_get('eaccelerator.enable'),
30 'wincache_enabled' => extension_loaded('wincache') && ini_get('wincache.ocenabled'),
31 'zend_opcache_enabled' => extension_loaded('Zend OPcache') && ini_get('opcache.enable'),
32 'sapi_name' => php_sapi_name(),
144 */
145 public function getPanelSummary() {
146 return $this->t('PHP: @version', ['@version' => $this->getPhpVersion()]);
147 }
ThreeWay.php (https://github.com/finger2000/horde.git) PHP · 137 lines
add_user.php (https://gitlab.com/x33n/ProjectPier-Core) PHP · 123 lines
58 <legend><?php echo lang('password') ?></legend>
59 <div>
60 <?php echo radio_field('user[password_generator]', array_var($user_data, 'password_generator') == 'random', array('value' => 'random', 'class' => 'checkbox', 'id' => 'userFormRandomPassword')) ?> <?php echo label_tag(lang('user password generate'), 'userFormRandomPassword', false, array('class' => 'checkbox'), '') ?>
61 </div>
62 <div>
63 <?php echo radio_field('user[password_generator]', array_var($user_data, 'password_generator') == 'specify', array('value' => 'specify', 'class' => 'checkbox', 'id' => 'userFormSpecifyPassword')) ?> <?php echo label_tag(lang('user password specify'), 'userFormSpecifyPassword', false, array('class' => 'checkbox'), '') ?>
64 </div>
65 <div id="userFormPasswordInputs">
89 </div>
91 <?php if (!extension_loaded('ldap')) { ?>
92 <div>
93 <?php echo label_tag(lang('use LDAP'), null, true) ?>
IpUtils.php (https://github.com/gimler/symfony.git) PHP · 156 lines
1 <?php
3 /*
99 * In case a subnet is given, it checks if it contains the request IP.
100 *
101 * @author David Soria Parra <dsp at php dot net>
102 *
103 * @see https://github.com/dsp/v6tools
117 }
119 if (!((\extension_loaded('sockets') && \defined('AF_INET6')) || @inet_pton('::1'))) {
120 throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".');
Db.php (https://github.com/rgranadino/magento-mirror.git) PHP · 192 lines
1 <?php
2 /**
3 * Magento
8 * that is bundled with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://opensource.org/licenses/osl-3.0.php
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
22 * @package Mage_Install
23 * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25 */
63 $extensions = $resource->getRequiredExtensions();
64 foreach ($extensions as $extName) {
65 if (!extension_loaded($extName)) {
66 $absenteeExtensions[] = $extName;
67 }
CacheMemcache.php (https://gitlab.com/jslee1/PrestaShop) PHP · 269 lines
1 <?php
2 /**
3 * 2007-2015 PrestaShop
8 * that is bundled with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://opensource.org/licenses/osl-3.0.php
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
21 * @author PrestaShop SA <contact@prestashop.com>
22 * @copyright 2007-2015 PrestaShop SA
23 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
24 * International Registered Trademark & Property of PrestaShop SA
25 */
56 public function connect()
57 {
58 if (class_exists('Memcache') && extension_loaded('memcache')) {
59 $this->memcache = new Memcache();
60 } else {
AdSenseHostAuth.php (https://bitbucket.org/insigngmbh/googlephpapi.git) PHP · 133 lines
1 <?php
2 /*
3 * Copyright 2012 Google Inc.
18 // Error if PDO and PDO_SQLITE not present
19 if (!extension_loaded('pdo') || !extension_loaded('pdo_sqlite')) {
20 throw new Exception('The sample code needs PDO and PDO_SQLITE PHP extension');
24 * Include the library files for the api client and AdSense service class.
25 */
26 require_once "../../src/Google_Client.php";
27 require_once "../../src/contrib/Google_AdsensehostService.php";
48 public function __construct() {
49 // Create the Google_Client instance.
50 // You can set your credentials in the config.php file, included under the
51 // src/ folder in your client library install.
52 $this->apiClient = new Google_Client();
Tar.php (https://github.com/jtai/zf2.git) PHP · 248 lines
1 <?php
2 /**
3 * Zend Framework
147 }
149 if (($mode == 'Bz2') && (!extension_loaded('bz2'))) {
150 throw new Exception\ExtensionNotLoadedException('This mode needs the bz2 extension');
151 }
153 if (($mode == 'Gz') && (!extension_loaded('zlib'))) {
154 throw new Exception\ExtensionNotLoadedException('This mode needs the zlib extension');
155 }
FactoryTest.php (https://github.com/WebTricks/WebTricks-CMS.git) PHP · 383 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: FactoryTest.php 20366 2010-01-18 03:56:52Z ralph $
21 */
23 require_once dirname(dirname(dirname(__FILE__))) . '/TestHelper.php';
25 require_once 'Zend/Barcode.php';
26 require_once 'Zend/Config.php';
28 /**
Openssl.php (https://github.com/frhumanes/PLM.git) PHP · 353 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Openssl.php 20288 2010-01-14 20:15:43Z thomas $
20 */
23 * @see Zend_Filter_Encrypt_Interface
24 */
25 require_once 'Zend/Filter/Encrypt/Interface.php';
27 /**
68 public function __construct($options = array())
69 {
70 if (!extension_loaded('openssl')) {
71 require_once 'Zend/Filter/Exception.php';
ReflectionCasterTest.php (https://github.com/gimler/symfony.git) PHP · 233 lines
1 <?php
3 /*
12 namespace Symfony\Component\VarDumper\Tests\Caster;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\VarDumper\Caster\Caster;
16 use Symfony\Component\VarDumper\Test\VarDumperTestTrait;
78 $b: & 123
79 }
80 file: "%sReflectionCasterTest.php"
81 line: "68 to 68"
82 }
145 class: "Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest"
146 this: Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest { …}
147 file: "%sReflectionCasterTest.php($line) : eval()'d code"
148 line: "1 to 1"
149 }
Base.php (https://github.com/bruisedlee/zf2.git) PHP · 254 lines
1 <?php
2 /**
3 * Zend Framework
58 public function __construct($options = array())
59 {
60 if (!extension_loaded('soap')) {
61 throw new Zend_Service_StrikeIron_Exception('SOAP extension is not enabled');
62 }
156 * Transform a method name or method parameters before sending them
157 * to the remote service. This can be useful for inflection or other
158 * transforms to give the method call a more PHP-like interface.
159 *
160 * @see __call()
161 * @param string $method Method name called from PHP
162 * @param mixed $param Parameters passed from PHP
LambdaClient.php (https://github.com/trob/fabrik.git) PHP · 161 lines
step_3.php (https://gitlab.com/dadangnh/sb1-bon) PHP · 303 lines
1 <?php
2 class ControllerInstallStep3 extends Controller {
3 private $error = array();
11 $this->model_install_install->database($this->request->post);
13 $output = '<?php' . "\n";
14 $output .= '// HTTP' . "\n";
15 $output .= 'define(\'HTTP_SERVER\', \'' . HTTP_OPENCART . '\');' . "\n\n";
40 $output .= 'define(\'DB_PREFIX\', \'' . addslashes($this->request->post['db_prefix']) . '\');' . "\n";
42 $file = fopen(DIR_OPENCART . 'config.php', 'w');
44 fwrite($file, $output);
46 fclose($file);
48 $output = '<?php' . "\n";
49 $output .= '// HTTP' . "\n";
50 $output .= 'define(\'HTTP_SERVER\', \'' . HTTP_OPENCART . 'admin/\');' . "\n";
Proxy.php (https://github.com/CloCkWeRX/sdo.git) PHP · 167 lines
1 <?php
2 /**
3 * +-----------------------------------------------------------------------------+
19 * | Author: Graham Charters, Caroline Maynard |
20 * +-----------------------------------------------------------------------------+
21 * $Id: Proxy.php 254122 2008-03-03 17:56:38Z mfp $
22 *
23 * PHP Version 5
25 * @category SCA
26 * @package SCA_SDO
27 * @author Simon Laws <slaws@php.net>
28 * @license Apache http://www.apache.org/licenses/LICENSE-2.0
29 * @link http://www.osoa.org/display/PHP/
30 */
32 require_once 'SCA/SCA_Exceptions.php';
33 require_once 'SCA/SCA_Helper.php';
SlackHandler.php (https://gitlab.com/4gdevs/online-class-record-system) PHP · 284 lines
1 <?php
3 /*
83 public function __construct($token, $channel, $username = 'Monolog', $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false)
84 {
85 if (!extension_loaded('openssl')) {
86 throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
commontypes.php (https://github.com/mfairchild365/zf2.git) PHP · 644 lines
PhpThumb.inc.php (https://gitlab.com/ptisky/API_prestashop) PHP · 246 lines
1 <?php
2 /**
3 * PhpThumb Library Definition File
4 *
5 * This file contains the definitions for the PhpThumb class.
7 * PHP Version 5 with GD 2.0+
8 * PhpThumb : PHP Thumb Library <http://phpthumb.gxdlabs.com>
9 * Copyright (c) 2009, Ian Selby/Gen X Design
10 *
25 /**
26 * PhpThumb Object
27 *
28 * This singleton object is essentially a function library that helps with core validation
38 * some crazy customization... then knock yourself out! :)
39 *
40 * @package PhpThumb
41 * @subpackage Core
42 */
S3SignatureV4.php (https://github.com/ocStore/ocStore.git) PHP · 156 lines
1 <?php
2 namespace Aws\Signature;
100 private function signWithV4a(CredentialsInterface $credentials, RequestInterface $request, $signingService)
101 {
102 if (!extension_loaded('awscrt')) {
103 throw new CommonRuntimeException(
104 "AWS Common Runtime for PHP is required to use Signature V4A and multi-region"
105 . " access points. Please install it using the instructions found at"
106 . " https://github.com/aws/aws-sdk-php/blob/master/CRT_INSTRUCTIONS.md"
107 );
108 }
Apc.php (https://github.com/goldoraf/OBM.git) PHP · 167 lines
1 <?php
2 /**
3 * Zend Framework
24 * @see Zend_Cache_Backend_Interface
25 */
26 require_once 'Zend/Cache/Backend/Interface.php';
28 /**
29 * @see Zend_Cache_Backend
30 */
31 require_once 'Zend/Cache/Backend.php';
49 public function __construct(array $options = array())
50 {
51 if (!extension_loaded('apc')) {
52 Zend_Cache::throwException('The apc extension must be loaded for using this backend !');
53 }
OfflineSecurityTokenServerTest.php (https://bitbucket.org/Dal-Papa/is-340-publish-base.git) PHP · 318 lines
1 <?php
2 /**
3 * Zend Framework
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: OfflineSecurityTokenServerTest.php 24791 2012-05-11 06:18:17Z bate $
21 */
23 if (!defined('PHPUnit_MAIN_METHOD')) {
24 define('PHPUnit_MAIN_METHOD', 'Zend_Service_DeveloperGarden_SecurityTokenServerTest::main');
28 * @see Zend_Service_DeveloperGarden_SecurityTokenServer
29 */
30 require_once 'Zend/Service/DeveloperGarden/SecurityTokenServer.php';
32 /**
Rar.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 230 lines
index.blade.php (https://gitlab.com/rodrigo.butta/bgh) PHP · 125 lines
9 <body>
10 <div class="container">
11 @if(!extension_loaded('imagick') && !extension_loaded('gd'))
12 <div class="alert alert-danger fade in">
13 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
14 <strong>Please enable Imagick or GD php extension</strong>
15 </div>
16 @endif
17 @if(!extension_loaded('fileinfo'))
18 <div class="alert alert-danger fade in">
19 <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
disqusapi.php (https://github.com/makerlabs/Symfohub.git) PHP · 154 lines
JCacheTest.php (https://github.com/pjwiseman/joomla-cms.git) PHP · 502 lines
1 <?php
2 /**
3 * @package Joomla.UnitTest
14 * @subpackage Cache
15 */
16 class JCacheTest extends PHPUnit_Framework_TestCase
17 {
18 /** @var JCache */
35 {
36 parent::setUp();
37 include_once JPATH_PLATFORM . '/joomla/cache/cache.php';
38 include_once JPATH_PLATFORM . '/joomla/cache/controller.php';
39 include_once JPATH_PLATFORM . '/joomla/cache/storage.php';
41 $this->checkAvailability();
CacheSqlite.class.php (https://github.com/liujinsong668/epptime.git) PHP · 169 lines
1 <?php
2 // +----------------------------------------------------------------------
3 // | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
4 // +----------------------------------------------------------------------
5 // | Copyright (c) 2009 http://thinkphp.cn All rights reserved.
6 // +----------------------------------------------------------------------
7 // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
34 public function __construct($options='')
35 {
36 if ( !extension_loaded('sqlite') ) {
37 throw_exception(L('_NOT_SUPPERT_').':sqlite');
38 }
XCacheTest.php (https://github.com/brtriver/sukonv.git) PHP · 348 lines
1 <?php
2 /**
3 * Lithium: the most rad php framework
4 *
5 * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)
6 * @license http://opensource.org/licenses/bsd-license.php The BSD License
7 */
19 */
20 public function skip() {
21 $extensionExists = (extension_loaded('xcache') && (ini_get('xcache.var_size') !== 0));
22 $message = 'The XCache extension is not installed or not configured for userspace caching.';
23 $this->skipIf(!$extensionExists, $message);
svn.php (https://github.com/agallou/atoum.git) PHP · 354 lines
65 ->object($this->testedInstance->setRepositoryUrl($url = uniqid()))->isTestedInstance
66 ->string($this->testedInstance->getRepositoryUrl())->isEqualTo($url)
67 ->object($this->testedInstance->setRepositoryUrl($url = rand(- PHP_INT_MAX, PHP_INT_MAX)))->isTestedInstance
68 ->string($this->testedInstance->getRepositoryUrl())->isEqualTo((string) $url)
69 ;
93 ->object($this->testedInstance->setUsername($username = uniqid()))->isTestedInstance
94 ->string($this->testedInstance->getUsername())->isEqualTo($username)
95 ->object($this->testedInstance->setUsername($username = rand(- PHP_INT_MAX, PHP_INT_MAX)))->isTestedInstance
96 ->string($this->testedInstance->getUsername())->isEqualTo((string) $username)
97 ;
109 ->object($this->testedInstance->setPassword($password = uniqid()))->isTestedInstance
110 ->string($this->testedInstance->getPassword())->isEqualTo($password)
111 ->object($this->testedInstance->setPassword($password = rand(- PHP_INT_MAX, PHP_INT_MAX)))->isTestedInstance
112 ->string($this->testedInstance->getPassword())->isEqualTo((string) $password)
113 ;
StreamContextFactoryTest.php (https://github.com/ecoleman/composer.git) PHP · 136 lines
1 <?php
3 /*
15 use Composer\Util\StreamContextFactory;
17 class StreamContextFactoryTest extends \PHPUnit_Framework_TestCase
18 {
19 protected function setUp()
109 $_SERVER['http_proxy'] = $proxy;
111 if (extension_loaded('openssl')) {
112 $context = StreamContextFactory::getContext();
113 $options = stream_context_get_options($context);
MimeTypeTest.php (https://github.com/ivebeenlinuxed/Boiler.git) PHP · 105 lines
1 <?php
3 /*
18 use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException;
20 class MimeTypeTest extends \PHPUnit_Framework_TestCase
21 {
22 protected $path;
24 public function testGuessImageWithoutExtension()
25 {
26 if (extension_loaded('fileinfo')) {
27 $this->assertEquals('image/gif', MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/test'));
28 } else {
42 $guesser = MimeTypeGuesser::getInstance();
43 $guesser->register(new FileBinaryMimeTypeGuesser());
44 if (extension_loaded('fileinfo')) {
45 $this->assertEquals('image/gif', MimeTypeGuesser::getInstance()->guess(__DIR__.'/../Fixtures/test'));
46 } else {
OracleTest.php (https://github.com/tanduy/zf.git) PHP · 140 lines
1 <?php
2 /**
3 * Zend Framework
21 */
23 require_once dirname(dirname(dirname(dirname(dirname(__FILE__))))) . DIRECTORY_SEPARATOR . 'TestHelper.php';
25 /**
26 * @see Zend_Paginator_Adapter_DbSelect
27 */
28 require_once 'Zend/Paginator/Adapter/DbSelect.php';
30 /**
31 * @see Zend_Db_Adapter_Oracle
32 */
33 require_once 'Zend/Db/Adapter/Oracle.php';
35 /**
XMLParser.php (https://github.com/livinglab/openlab.git) PHP · 247 lines
1 <?php
2 /**
3 * PEAR_XMLParser
4 *
5 * PHP versions 4 and 5
6 *
7 * @category pear
8 * @package PEAR
9 * @author Greg Beaver <cellog@php.net>
10 * @author Stephan Schmidt (original XML_Unserializer code)
11 * @copyright 1997-2009 The Authors
12 * @license http://opensource.org/licenses/bsd-license New BSD License
13 * @link http://pear.php.net/package/PEAR
14 * @since File available since Release 1.4.0a1
15 */
StringUtils.php (https://gitlab.com/x33n/ImpressPages) PHP · 189 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
15 /**
16 * Utility class for handling strings of different character encodings
17 * using available PHP extensions.
18 *
19 * Declared abstract, as we have no need for instantiation.
60 static::$wrapperRegistry = array();
62 if (extension_loaded('intl')) {
63 static::$wrapperRegistry[] = 'Zend\Stdlib\StringWrapper\Intl';
64 }
66 if (extension_loaded('mbstring')) {
67 static::$wrapperRegistry[] = 'Zend\Stdlib\StringWrapper\MbString';
68 }
String.class.php (https://github.com/treuter/xp-framework.git) PHP · 344 lines
bzip2.php (https://bitbucket.org/pastor399/newcastleunifc.git) PHP · 176 lines
NormalUnitTests.php (https://github.com/pear/phpuc.git) PHP · 118 lines
5 echo '<?xml version="1.0" encoding="UTF-8"?>';
6 ?>
7 <project name="<?php print $p->package; ?>" basedir="<?php print $p->source; ?>/<?php print $p->package; ?>" default="build">
8 <target name="php-codesniffer">
9 <exec executable="phpcs" dir="${basedir}" output="<?php print $p->jenkins; ?>/projects/<?php print $p->package; ?>/build/logs/checkstyle.xml">
10 <arg line="--report=checkstyle --standard=PEAR --ignore=tests <?php print $p->source; ?>/<?php print $p->package; ?>"/>
50 <exec executable="php" dir="${basedir}" failonerror="on">
51 <arg line="<?php print $p->pyrus ?> package -o <?php print $p->jenkins; ?>/projects/<?php print $p->package; ?>/build/package/trunk.tar.gz" />
52 </exec>
60 <?php if ($p->pyrus) { ?>
61 <target name="build" depends="php-codesniffer,phpmd,phpcpd,phpunit,package" />
62 <?php } else { ?>
63 <target name="build" depends="php-codesniffer,phpmd,phpcpd,phpunit" />
64 <?php } ?>
Rsa.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 343 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
38 public static function factory($options)
39 {
40 if (!extension_loaded('openssl')) {
41 throw new Exception\RuntimeException(
42 'Can not create Zend\Crypt\PublicKey\Rsa; openssl extension to be loaded'
100 public function __construct(RsaOptions $options = null)
101 {
102 if (!extension_loaded('openssl')) {
103 throw new Exception\RuntimeException(
104 'Zend\Crypt\PublicKey\Rsa requires openssl extension to be loaded'
Xcache.php (https://gitlab.com/Ltaimao/wecenter) PHP · 221 lines
1 <?php
2 /**
3 * Zend Framework
173 if (isset($_SERVER['PHP_AUTH_USER'])) {
174 $backup['PHP_AUTH_USER'] = $_SERVER['PHP_AUTH_USER'];
175 }
176 if (isset($_SERVER['PHP_AUTH_PW'])) {
177 $backup['PHP_AUTH_PW'] = $_SERVER['PHP_AUTH_PW'];
178 }
179 if ($this->_options['user']) {
192 $_SERVER['PHP_AUTH_USER'] = $backup['PHP_AUTH_USER'];
193 $_SERVER['PHP_AUTH_PW'] = $backup['PHP_AUTH_PW'];
194 }
195 return true;
DecryptTest.php (https://bitbucket.org/gencer/zf2.git) PHP · 142 lines
Memcached.php (https://github.com/xoops-pi/engine.git) PHP · 122 lines
1 <?php
2 /**
3 * Kernel service
12 * @copyright Xoops Engine http://www.xoopsengine.org/
13 * @license http://www.fsf.org/copyleft/gpl.html GNU public license
14 * @author Taiwen Jiang <phppp@users.sourceforge.net>
15 * @since 3.0
16 * @package Kernel/Service
29 {
30 if (is_string($config)) {
31 $config = \Xoops::loadConfig("memcached." . $config . ".ini.php");
32 }
51 if (is_string($value)) {
52 $memcachedValue = 'Memcached::' . strtoupper($value);
53 $value = defined($memcachedValue) ? constant($memcachedValue) : $value; // For Memcached predefined constants, see http://www.php.net/manual/en/memcached.constants.php
54 }
55 $clients[$optId] = $value;
checker.php (https://gitlab.com/billyprice1/rapidleech) PHP · 127 lines
16 $phpver = phpversion();
17 $phpverr = str_replace(".", "", $phpver);
19 if ($phpverr >= 430) {
104 <b><?php echo lang(314); ?></b>: <?php echo $fsockopen; ?><br /><br />
105 <b><?php echo lang(315); ?></b>: <?php echo $memory_limit; ?><br /><br />
106 <b><?php echo lang(316); ?></b>: <?php echo $safemode; ?><br /><br />
108 <b><?php echo lang(318); ?></b>: <?php echo $fopen; ?><br /><br />
109 <b><?php echo lang(319); ?><?php echo $phpver; ?></b>: <?php echo $phpverr; ?><br /><br />
110 <b><?php echo lang(320); ?></b>: <?php echo $call_time; ?><br /><br />
112 <b><?php echo lang(322); ?></b>: <?php echo $disk_free_space; ?><br /><br />
113 <b><?php echo lang(388); ?></b>: <?php echo $ssl; ?><br /><br />
114 <?php if ($apache_version) {
115 ?>
116 <b><?php echo lang(323); ?><?php echo $apache_version; ?></b>: <?php echo $apacver; ?><br /><br />
117 <?php
environment.php (https://github.com/nadavkav/MoodleTAO.git) PHP · 191 lines
1 <?php // $Id$
2 /**
3 * Info about the local environment, wrt RPC
4 *
5 * This should really be a singleton. A PHP5 Todo I guess.
6 */
97 // record to have an email address, city and country already.
98 if (!empty($_SESSION['upgraderunning'])) return true;
99 if (!extension_loaded("openssl")) return true;
100 if (!empty($this->keypair)) return true;
UploadedFileTest.php (https://gitlab.com/techniconline/kmc) PHP · 272 lines
1 <?php
3 /*
14 use Symfony\Component\HttpFoundation\File\UploadedFile;
16 class UploadedFileTest extends \PHPUnit_Framework_TestCase
17 {
18 protected function setUp()
19 {
20 if (!ini_get('file_uploads')) {
21 $this->markTestSkipped('file_uploads is disabled in php.ini');
22 }
23 }
46 $this->assertEquals('application/octet-stream', $file->getClientMimeType());
48 if (extension_loaded('fileinfo')) {
49 $this->assertEquals('image/gif', $file->getMimeType());
50 }
Imagick.php (https://gitlab.com/szlongshu/manaphp) PHP · 258 lines
1 <?php
3 namespace ManaPHP\Image\Adapter {
5 use ManaPHP\Image\AdapterInterface;
7 class Imagick implements AdapterInterface
31 * @param string $file
32 *
33 * @throws \ManaPHP\Image\Adapter\Exception
34 */
35 public function __construct($file)
36 {
37 if (!extension_loaded('imagick')) {
38 throw new Exception('Imagick is not installed, or the extension is not loaded');
39 }
Gz.php (https://github.com/MontmereLimited/ZendFramework-v1.git) PHP · 228 lines
1 <?php
2 /**
3 * Zend Framework
17 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Gz.php 23775 2011-03-01 17:25:24Z ralph $
20 */
23 * @see Zend_Filter_Compress_CompressAbstract
24 */
25 // // // // // // // // // // require_once 'Zend/Filter/Compress/CompressAbstract.php';
27 /**
58 public function __construct($options = null)
59 {
60 if (!extension_loaded('zlib')) {
61 // // // // // // // // // // require_once 'Zend/Filter/Exception.php';
PostgreSQLConnection.class.php (https://github.com/treuter/xp-framework.git) PHP · 216 lines
1 <?php
2 /* This class is part of the XP framework
3 *
17 *
18 * @see http://www.postgresql.org/
19 * @see http://www.freebsddiary.org/postgresql.php
20 * @ext pgsql
21 * @purpose Database connection
27 static function __static() {
28 if (extension_loaded('pgsql')) {
29 DriverManager::register('pgsql+std', new XPClass(__CLASS__));
30 }
ImageTest.php (https://bitbucket.org/gencer/zf2.git) PHP · 357 lines
CollectionInputFilterTest.php (https://github.com/cgmartin/zf2.git) PHP · 438 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
10 namespace ZendTest\InputFilter;
12 use PHPUnit_Framework_TestCase as TestCase;
13 use Zend\InputFilter\BaseInputFilter;
14 use Zend\InputFilter\CollectionInputFilter;
112 public function testInputFilterInputsAppliedToCollection()
113 {
114 if (!extension_loaded('intl')) {
115 $this->markTestSkipped('ext/intl not enabled');
116 }
163 public function testCanValidateValidData()
164 {
165 if (!extension_loaded('intl')) {
166 $this->markTestSkipped('ext/intl not enabled');
167 }
Diff3.php (https://bitbucket.org/hamaswa/destinationgreece.git) PHP · 276 lines
1 <?php
2 /**
3 * A class for computing three way diffs.
4 *
5 * $Horde: framework/Text_Diff/Diff3.php,v 1.2.10.6 2008/01/04 10:37:26 jan Exp $
6 *
7 * Copyright 2007-2008 The Horde Project (http://www.horde.org/)
8 *
9 * See the enclosed file COPYING for license information (LGPL). If you did
10 * not receive this file, see http://opensource.org/licenses/lgpl-license.php.
11 *
12 * @package Text_Diff
16 /** Text_Diff */
17 require_once 'Text/Diff.php';
19 /**