100+ results for 'php version_compare'
Not the results you expected?
Root.php (https://github.com/ewandor/horde.git) PHP · 192 lines
1 <?php
2 /**
3 * Handles the document root.
4 *
5 * PHP version 5
6 *
7 * @category Kolab
96 $attributes['_api-version'] = $params['api-version'];
97 if (!$this->isRelaxed($params)) {
98 if (version_compare($params['expected-version'], $attributes['_format-version']) < 0) {
99 throw new Horde_Kolab_Format_Exception_InvalidRoot(
100 sprintf(
145 } else {
146 if (!$this->isRelaxed($params)) {
147 if (version_compare($params['expected-version'], $root->getAttribute('version')) < 0) {
148 throw new Horde_Kolab_Format_Exception_InvalidRoot(
149 sprintf(
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
ExportCsvTest.php (https://github.com/omigeot-ccpo/SemanticScuttle-SSO.git) PHP · 262 lines
1 <?php
2 /**
3 * SemanticScuttle - your social bookmark manager.
4 *
5 * PHP version 5.
6 *
7 * @category Bookmarking
13 * @link http://sourceforge.net/projects/semanticscuttle
14 */
15 require_once 'HTTP/Request2.php';
17 /**
234 protected function getCsvArray($body)
235 {
236 $v53 = (version_compare(PHP_VERSION, '5.3.0') === 1);
238 //dead simple implementation that does not work with
PluginInfo.php (https://gitlab.com/fabiorf/chat) PHP · 383 lines
LiveDocx.php (https://github.com/Martin1982/IBMessagingWorkshopServer.git) PHP · 415 lines
1 <?php
2 /**
3 * Zend Framework
78 *
79 * {code}
80 * $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
81 * array (
82 * 'username' => 'myUsername',
94 *
95 * {code}
96 * $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
97 * array (
98 * 'username' => 'myUsername',
106 *
107 * {code}
108 * $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
109 *
110 * $phpLiveDocx->setUsername('myUsername')
Query.php (https://github.com/mpous/mandango.git) PHP · 606 lines
ClassMapAutoloader.php (https://gitlab.com/LisovyiEvhenii/ismextensions) PHP · 248 lines
1 <?php
2 /**
3 * Zend Framework
21 // Grab SplAutoloader interface
22 #require_once dirname(__FILE__) . '/SplAutoloader.php';
24 /**
157 public function register()
158 {
159 if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
160 spl_autoload_register(array($this, 'autoload'), true, true);
161 } else {
199 * Resolve the real_path() to a file within a phar.
200 *
201 * @see https://bugs.php.net/bug.php?id=52769
202 * @param string $path
203 * @return string
StorageTest.php (https://bitbucket.org/saifshuvo/zf2.git) PHP · 256 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
19 * @group Zend_Session
20 */
21 class StorageTest extends \PHPUnit_Framework_TestCase
22 {
23 /**
247 public function testUnsetMultidimensional()
248 {
249 if (version_compare(PHP_VERSION, '5.3.4') < 0) {
250 $this->markTestSkipped('Known issue on versions of PHP less than 5.3.4');
admin.php (https://bitbucket.org/adatux_/uakami.git) PHP · 164 lines
1 <?php
2 // Direct calls to this file are Forbidden when core files are not present
3 if (!function_exists ('add_action')) {
52 // Load scripts and styles only on BPS specified pages
53 add_action('load-bulletproof-security/admin/options.php', 'bulletproof_security_load_settings_page');
55 }
64 add_menu_page(__('BulletProof Security ~ htaccess Core', 'bulletproof-security'), __('BPS Security', 'bulletproof-security'), 'manage_options', 'bulletproof-security/admin/options.php', '', plugins_url('bulletproof-security/admin/images/bps-icon-small.png'));
65 add_submenu_page('bulletproof-security/admin/options.php', __('BulletProof Security ~ htaccess Core', 'bulletproof-security'), __('BPS Settings', 'bulletproof-security'), 'manage_options', 'bulletproof-security/admin/options.php' );
66 }}
85 $previous_install = get_option('bulletproof_security_options');
86 if ( $previous_install ) {
87 if ( version_compare($previous_install['version'], '.48', '<') )
88 remove_role('denied');
89 }
reflection_php5.php (https://github.com/jarednipper/HSU-common-code.git) PHP · 280 lines
1 <?php
2 /**
3 * base include file for SimpleTest
26 /**
27 * Checks that a class has been declared. Versions
28 * before PHP5.0.2 need a check that it's not really
29 * an interface.
30 * @return boolean True if defined.
41 /**
42 * Needed to kill the autoload feature in PHP5
43 * for classes created dynamically.
44 * @return boolean True if defined.
200 return 'function __call($method, $arguments)';
201 }
202 if (version_compare(phpversion(), '5.1.0', '>=')) {
203 if (in_array($name, array('__get', '__isset', $name == '__unset'))) {
204 return "function {$name}(\$key)";
Components.php (https://github.com/ameximes/akelos.git) PHP · 108 lines
1 <?php
2 // +----------------------------------------------------------------------+
3 // | PHP Version 4 |
4 // +----------------------------------------------------------------------+
5 // | Copyright (c) 1997-2004 The PHP Group |
6 // +----------------------------------------------------------------------+
7 // | This source file is subject to version 3.0 of the PHP license, |
8 // | that is bundled with this package in the file LICENSE, and is |
9 // | available at through the world-wide-web at |
10 // | http://www.php.net/license/3_0.txt. |
11 // | If you did not receive a copy of the PHP license and are unable to |
12 // | obtain it through the world-wide-web, please send a note to |
13 // | license@php.net so we can mail you a copy immediately. |
14 // +----------------------------------------------------------------------+
15 // | Authors: Aidan Lister <aidan@php.net> |
MethodProphecy.php (https://gitlab.com/techniconline/kmc) PHP · 443 lines
Scrypt.php (https://bitbucket.org/zbahij/eprojets_app.git) PHP · 342 lines
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
36 throw new Exception\InvalidArgumentException("N must be > 0 and a power of 2");
37 }
38 if ($n > PHP_INT_MAX / 128 / $r) {
39 throw new Exception\InvalidArgumentException("Parameter n is too large");
40 }
41 if ($r > PHP_INT_MAX / 128 / $p) {
42 throw new Exception\InvalidArgumentException("Parameter r is too large");
43 }
330 protected static function hex2bin($hex)
331 {
332 if (version_compare(PHP_VERSION, '5.4') >= 0) {
333 return hex2bin($hex);
334 }
Settings.php (https://gitlab.com/techniconline/kmc) PHP · 392 lines
22 * @package PHPExcel_Settings
23 * @copyright Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
24 * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25 * @version ##VERSION##, ##DATE##
33 define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../');
34 require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
35 }
118 * @param string $zipClass The Zip handler class that PHPExcel should use for Zip file management
119 * e.g. PHPExcel_Settings::PCLZip or PHPExcel_Settings::ZipArchive
120 * @return boolean Success or failure
121 */
138 * @return string Name of the Zip handler Class that PHPExcel is configured to use
139 * for Zip file management
140 * e.g. PHPExcel_Settings::PCLZip or PHPExcel_Settings::ZipArchive
141 */
142 public static function getZipClass()
SystemPackage.php (https://gitlab.com/crazybutterfly815/magento2) PHP · 263 lines
1 <?php
2 /**
3 * Copyright © 2016 Magento. All rights reserved.
185 {
186 usort($enterpriseVersions['available_versions'], function ($versionOne, $versionTwo) {
187 if (version_compare($versionOne, $versionTwo, '==')) {
188 return 0;
189 }
190 return (version_compare($versionOne, $versionTwo, '<')) ? 1 : -1;
191 });
221 usort($versions, function ($versionOne, $versionTwo) {
222 if (version_compare($versionOne['id'], $versionTwo['id'], '==')) {
223 if ($versionOne['package'] === 'magento/product-community-edition') {
224 return 1;
reflection_php5.php (https://github.com/cgajardo/repositorium.git) PHP · 380 lines
4 * @package SimpleTest
5 * @subpackage UnitTester
6 * @version $Id: reflection_php5.php 1683 2008-03-05 21:57:08Z lastcraft $
7 */
287 return 'function __call($method, $arguments)';
288 }
289 if (version_compare(phpversion(), '5.1.0', '>=')) {
290 if (in_array($name, array('__get', '__isset', $name == '__unset'))) {
291 return "function {$name}(\$key)";
335 $signature = '';
336 $type = $parameter->getClass();
337 if (is_null($type) && version_compare(phpversion(), '5.1.0', '>=') && $parameter->isArray()) {
338 $signature .= 'array ';
339 } elseif (!is_null($type)) {
Set.php (https://github.com/CloCkWeRX/Pyrus.git) PHP · 284 lines
1 <?php
2 /**
3 * \Pyrus\Dependency\Set
4 *
5 * PHP version 5
6 *
7 * @category Pyrus
8 * @package Pyrus
9 * @author Greg Beaver <cellog@php.net>
10 * @copyright 2010 The PEAR Group
11 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
23 * @category Pyrus
24 * @package Pyrus
25 * @author Greg Beaver <cellog@php.net>
26 * @copyright 2010 The PEAR Group
27 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
Imagine.php (https://github.com/ndusan/bginfobox.git) PHP · 225 lines
1 <?php
3 /*
58 private function requireGdVersion($version)
59 {
60 if (version_compare(GD_VERSION, $version, '<')) {
61 throw new RuntimeException('GD2 version 2.0.1 or higher is required');
62 }
65 /**
66 * (non-PHPdoc)
67 * @see Imagine\Image\ImagineInterface::create()
68 */
111 /**
112 * (non-PHPdoc)
113 * @see Imagine\Image\ImagineInterface::open()
114 */
FileManager.php (https://github.com/livinglab/openlab.git) PHP · 242 lines
1 <?php
3 if ( ! defined( 'ABSPATH' ) ) {
147 */
148 public function json_encode_files( $files ) {
149 if ( version_compare( phpversion(), "5.4.0", ">=" ) ) {
150 $files = json_encode( $files, JSON_UNESCAPED_UNICODE );
151 } else {
164 /**
165 * Fallback for PHP < 5.4 where JSON_UNESCAPED_UNICODE does not exist.
166 *
167 * @param array $matches
smarty_internal_cacheresource_file.php (https://gitlab.com/adamlwalker/generatedata) PHP · 264 lines
1 <?php
2 /**
3 * Smarty Internal Plugin CacheResource File
61 $cached->lock_id = $_lock_dir.sha1($_cache_id.$_compile_id.$_template->source->uid).'.lock';
62 }
63 $cached->filepath = $_cache_dir . $_cache_id . $_compile_id . $_filepath . '.' . basename($_source_file_path) . '.php';
64 $cached->timestamp = @filemtime($cached->filepath);
65 $cached->exists = !!$cached->timestamp;
228 public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
229 {
230 if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
231 clearstatcache(true, $cached->lock_id);
232 } else {
compatibility.php (https://github.com/h-kanjisan/swiftmailer.git) PHP · 166 lines
15 /**
16 * Creates a copy whether in PHP5 or PHP4.
17 * @param object $object Thing to copy.
18 * @return object A copy.
20 */
21 static function copy($object) {
22 if (version_compare(phpversion(), '5') >= 0) {
23 eval('$copy = clone $object;');
24 return $copy;
37 */
38 static function isIdentical($first, $second) {
39 if (version_compare(phpversion(), '5') >= 0) {
40 return SimpleTestCompatibility::isIdenticalType($first, $second);
41 }
Manager.php (https://github.com/noose/zf2.git) PHP · 307 lines
1 <?php
3 namespace Zend\Module;
119 if ($dep === 'php') {
120 if (!version_compare(PHP_VERSION, $matches[2][0], $matches[1][0] ?: '>=')) {
121 if ($depInfo['required'] == true) {
122 throw new \RuntimeException("Required dependency unsatisfied: {$dep} {$depInfo['version']}");
127 } elseif (substr($dep, 0, 4) === 'ext/') {
128 $extName = substr($dep, 4);
129 if (!version_compare(phpversion($extName), $matches[2][0], $matches[1][0] ?: '>=')) {
130 if ($depInfo['required'] == true) {
131 throw new \RuntimeException("Required dependency unsatisfied: {$dep} {$depInfo['version']}");
144 continue;
145 }
146 if (version_compare($provides['version'], $matches[2][0], $matches[1][0] ?: '>=')) {
147 $satisfied = true;
148 break;
cus_customer_data_views.php (https://gitlab.com/ptisky/API_prestashop) PHP · 58 lines
PrivateAccessibilityTest.class.php (https://github.com/ghiata/xp-framework.git) PHP · 377 lines
1 <?php namespace net\xp_framework\unittest\reflection;
3 use unittest\TestCase;
24 #[@beforeClass]
25 public static function initializeClasses() {
26 if (version_compare(PHP_VERSION, '5.3.2', 'lt')) {
27 throw new \unittest\PrerequisitesNotMetError('Private not supported', null, array('PHP 5.3.2'));
axis_rotated_boxed_renderer_test.php (https://github.com/F5/zetacomponents.git) PHP · 304 lines
1 <?php
2 /**
3 * ezcGraphAxisRotatedRendererTest
26 */
28 require_once dirname( __FILE__ ) . '/test_case.php';
30 /**
46 public static function suite()
47 {
48 return new PHPUnit_Framework_TestSuite( __CLASS__ );
49 }
53 static $i = 0;
55 if ( version_compare( phpversion(), '5.1.3', '<' ) )
56 {
57 $this->markTestSkipped( "This test requires PHP 5.1.3 or later." );
smarty_internal_cacheresource_file.php (https://github.com/GuessWho/don-t-enter.git) PHP · 259 lines
1 <?php
2 /**
3 * Smarty Internal Plugin CacheResource File
61 $cached->lock_id = $_lock_dir.sha1($_cache_id.$_compile_id.$_template->source->uid).'.lock';
62 }
63 $cached->filepath = $_cache_dir . $_cache_id . $_compile_id . $_filepath . '.' . basename($_source_file_path) . '.php';
64 Smarty::muteExpectedErrors();
65 $cached->timestamp = @filemtime($cached->filepath);
223 public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
224 {
225 if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
226 clearstatcache(true, $cached->lock_id);
227 } else {
simpletest.php (https://github.com/limb-php-framework/limb-app-buildman.git) PHP · 282 lines
1 <?php
2 /**
3 * Global state for SimpleTest and kicker script in future versions.
4 * @package SimpleTest
5 * @subpackage UnitTester
6 * @version $Id: simpletest.php 4378 2006-10-27 10:04:53Z pachanga $
7 */
10 * include SimpleTest files
11 */
12 if (version_compare(phpversion(), '5') >= 0) {
13 require_once(dirname(__FILE__) . '/reflection_php5.php');
14 } else {
15 require_once(dirname(__FILE__) . '/reflection_php4.php');
16 }
17 /**#@-*/
reflection_php5.php (https://github.com/greevex/mzz-framework-blank-application.git) PHP · 380 lines
4 * @package SimpleTest
5 * @subpackage UnitTester
6 * @version $Id: reflection_php5.php 2460 2008-04-08 21:03:22Z mz $
7 */
287 return 'function __call($method, $arguments)';
288 }
289 if (version_compare(phpversion(), '5.1.0', '>=')) {
290 if (in_array($name, array('__get', '__isset', $name == '__unset'))) {
291 return "function {$name}(\$key)";
335 $signature = '';
336 $type = $parameter->getClass();
337 if (is_null($type) && version_compare(phpversion(), '5.1.0', '>=') && $parameter->isArray()) {
338 $signature .= 'array ';
339 } elseif (!is_null($type)) {
Decorators.php (https://github.com/kugu/limb.git) PHP · 363 lines
5 // | PHP Version 4 |
6 // +----------------------------------------------------------------------+
7 // | Copyright (c) 1997-2002 The PHP Group |
8 // +----------------------------------------------------------------------+
9 // | This source file is subject to version 2.02 of the PHP license, |
13 // | If you did not receive a copy of the PHP license and are unable to |
14 // | obtain it through the world-wide-web, please send a note to |
15 // | license@php.net so we can mail you a copy immediately. |
16 // +----------------------------------------------------------------------+
17 // | Authors: Alexander Zhukov <alex@veresk.ru> Original port from Python |
256 * Compatibility with older PHP versions
257 */
258 if (version_compare(phpversion(), '4.3', '<') && !function_exists('html_entity_decode') ) {
259 function html_entity_decode($str, $style=ENT_NOQUOTES) {
260 return strtr($str,
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 */
68 }
69 if (!empty($absenteeExtensions)) {
70 Mage::throwException(Mage::helper('install')->__('PHP Extensions "%s" must be loaded.',
71 implode(',', $absenteeExtensions))
72 );
MoodBar.php (https://github.com/ChuguluGames/mediawiki-svn.git) PHP · 142 lines
1 <?php
2 /**
3 * MoodBar extension
16 // Object model
17 $wgAutoloadClasses['MBFeedbackItem'] = dirname(__FILE__).'/FeedbackItem.php';
18 $wgAutoloadClasses['MoodBarFormatter'] = dirname(__FILE__).'/Formatter.php';
20 // API
21 $wgAutoloadClasses['ApiMoodBar'] = dirname(__FILE__).'/ApiMoodBar.php';
22 $wgAPIModules['moodbar'] = 'ApiMoodBar';
24 // Hooks
25 $wgAutoloadClasses['MoodBarHooks'] = dirname(__FILE__).'/MoodBar.hooks.php';
26 $wgHooks['BeforePageDisplay'][] = 'MoodBarHooks::onPageDisplay';
27 $wgHooks['ResourceLoaderGetConfigVars'][] = 'MoodBarHooks::resourceLoaderGetConfigVars';
Error.php (https://github.com/israelnoguera/parejas.git) PHP · 195 lines
ResponseCollection.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 424 lines
test_ext_options.cpp (https://github.com/fungos/hiphop-php.git) C++ · 424 lines
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010- Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 */
reflection_php5.php (https://github.com/quarkness/piwik.git) PHP · 383 lines
4 * @package SimpleTest
5 * @subpackage UnitTester
6 * @version $Id: reflection_php5.php 1683 2008-03-05 21:57:08Z lastcraft $
7 */
287 return 'function __call($method, $arguments)';
288 }
289 if (version_compare(phpversion(), '5.1.0', '>=')) {
290 if (in_array($name, array('__get', '__isset', $name == '__unset'))) {
291 return "function {$name}(\$key)";
295 return "function $name()";
296 }
297 if (version_compare(phpversion(), '5.4', '>=')) {
298 return $this->_getFullSignature($name);
299 }
Theme.class.php (https://github.com/shafiqissani/ASTRA-College-Website.git) PHP · 301 lines
1 <?php
2 /* $Id: Theme.class.php 9902 2007-02-01 13:25:54Z cybot_tm $ */
41 function loadInfo()
42 {
43 if (! file_exists($this->getPath() . '/info.inc.php')) {
44 return false;
45 }
47 if ($this->mtime_info === filemtime($this->getPath() . '/info.inc.php')) {
48 return true;
49 }
51 @include $this->getPath() . '/info.inc.php';
53 // did it set correctly?
version_compare.php (https://github.com/soverc/writehive_server.git) PHP · 179 lines
8 // | that is bundled with this package in the file LICENSE, and is |
9 // | available at through the world-wide-web at |
10 // | http://www.php.net/license/3_0.txt. |
11 // | If you did not receive a copy of the PHP license and are unable to |
17 // +----------------------------------------------------------------------+
18 //
19 // $Id: version_compare.php 2 2009-03-16 20:22:51Z ggiunta $
23 * Replace version_compare()
24 *
25 * @category PHP
26 * @package PHP_Compat
27 * @link http://php.net/function.version_compare
28 * @author Philippe Jausions <Philippe.Jausions@11abacus.com>
29 * @author Aidan Lister <aidan@php.net>
LineFormatter.php (https://github.com/mhoofman/wordpress-heroku.git) PHP · 130 lines
pearweb_election.php (https://github.com/till/pearweb.git) PHP · 169 lines
1 <?php
2 require_once 'MDB2/Schema.php';
66 function initializeDatabase($answers)
67 {
68 //include_once dirname(__FILE__) . 'include/pear-config.php';
69 //$a = MDB2_Schema::factory(PEAR_DATABASE_DSN,
70 $this->dsn = array(
71 'phptype' => $answers['driver'],
72 'username' => $answers['user'],
73 'password' => $answers['password'],
119 continue;
120 }
121 if (version_compare($entry, $oldversion, '>')) {
122 $oldversion = $entry;
123 }
upgrade.php (https://github.com/netconstructor/WordPress.git) PHP · 110 lines
38 $php_version = phpversion();
39 $mysql_version = $wpdb->db_version();
40 $php_compat = version_compare( $php_version, $required_php_version, '>=' );
41 $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
62 <p class="step"><a class="button" href="<?php echo get_option( 'home' ); ?>/"><?php _e( 'Continue' ); ?></a></p>
64 <?php elseif ( !$php_compat || !$mysql_compat ) :
65 if ( !$mysql_compat && !$php_compat )
66 printf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version );
67 elseif ( !$php_compat )
68 printf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version );
69 elseif ( !$mysql_compat )
70 printf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version );
81 <p><?php _e( 'The update process may take a little while, so please be patient.' ); ?></p>
82 <p class="step"><a class="button" href="upgrade.php?step=1&backto=<?php echo $goback; ?>"><?php _e( 'Update WordPress Database' ); ?></a></p>
83 <?php
cat_quicksearch_get.php (https://gitlab.com/ptisky/API_prestashop) PHP · 111 lines
1 <?php
2 /**
3 * Store Commander
29 $ean=Tools::getValue('ean',1);
30 $upc=0;
31 if (version_compare(_PS_VERSION_, '1.4.0.2', '>='))
32 $upc=Tools::getValue('upc',1);
33 $limit=25*$nblanguages;
62 ".(($reference==1)?" OR pa.reference LIKE '%".psql($_GET['q'])."%'":"")."
63 ".(($supplier_reference==1)?" OR pa.supplier_reference LIKE '%".psql($_GET['q'])."%'":"")."
64 ".(version_compare(_PS_VERSION_,"1.4.0.2",">=")&&($upc==1)?" OR p.upc LIKE '%".psql($_GET['q'])."%'":"")."
65 ".(version_compare(_PS_VERSION_,"1.4.0.2",">=")&&($upc==1)?" OR pa.upc LIKE '%".psql($_GET['q'])."%'":"")."
CodeCoverageTest.php (https://gitlab.com/zan_zan/laravel_sample) PHP · 468 lines
26 * @since Class available since Release 1.0.0
27 */
28 class PHP_CodeCoverageTest extends PHP_CodeCoverage_TestCase
29 {
30 private $coverage;
159 /**
160 * @covers PHP_CodeCoverage::setForceCoversAnnotation
161 */
162 public function testSetForceCoversAnnotation()
266 );
268 if (version_compare(PHPUnit_Runner_Version::id(), '4.7', '>=')) {
269 $size = 'unknown';
270 } else {
class-envato-wordpress-theme-upgrader.php (https://bitbucket.org/rchlmrtn/chiari.git) PHP · 383 lines
1 e<?php
3 /**
9 */
11 include_once( ABSPATH . 'wp-admin/includes/file.php' );
12 include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
13 include_once( 'class-envato-protected-api.php' );
15 if ( class_exists( 'Theme_Upgrader' ) && ! class_exists( 'Envato_WordPress_Theme_Upgrader' ) ) {
220 protected function is_newer_version_available($installed_vesion, $latest_version)
221 {
222 return version_compare($installed_vesion, $latest_version, '<');
223 }
cat_product_data_views.php (https://gitlab.com/ptisky/API_prestashop) PHP · 86 lines
1 <?php
2 /**
3 * Store Commander
34 );
36 if (version_compare(_PS_VERSION_, '1.4.0.0', '>='))
37 {
38 $grids=array(
49 );
50 }
51 if (version_compare(_PS_VERSION_, '1.5.0.0', '>='))
52 {
53 $grids=array(
81 }
82 /*if(version_compare(_PS_VERSION_, '1.6.0.11', '>='))
83 {
84 $grids["grid_discount"]=str_replace(",reduction_from,", ",reduction_tax,reduction_from,", $grids["grid_discount"]);
DateTimeToStringTransformerTest.php (https://github.com/nattaphat/hgis.git) PHP · 181 lines
1 <?php
3 /*
38 // not bijective
39 // this will not work as php will use actual date to replace missing info
40 // and after change of date will lookup for closest Wednesday
41 // i.e. value: 2010-02, php value: 2010-02-(today i.e. 20), parsed date: 2010-02-24
62 // This test will fail < 5.3.9 - see https://bugs.php.net/51994
63 if (version_compare(phpversion(), '5.3.9', '>=')) {
64 $data[] = array('Y-z', '2010-33', '2010-02-03 00:00:00 UTC');
65 }
112 public function testReverseTransformUsingPipe($format, $input, $output)
113 {
114 if (version_compare(phpversion(), '5.3.7', '<')) {
115 $this->markTestSkipped('Pipe usage requires PHP 5.3.7 or newer.');
Element.php (https://github.com/rgranadino/magento-mirror.git) PHP · 123 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_XmlConnect
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 */
43 if (sizeof($source->children())) {
44 /**
45 * @link http://bugs.php.net/bug.php?id=41867 , fixed in 5.2.4
46 */
47 if (version_compare(phpversion(), '5.2.4', '<')===true) {
UnneededControlParenthesesFixerTest.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 391 lines
versioning.c (https://gitlab.com/envieidoc/advancedtomato2) C · 255 lines
123 /* }}} */
124 /* {{{ php_version_compare() */
126 PHPAPI int
209 Compares two "PHP-standardized" version number strings */
211 PHP_FUNCTION(version_compare)
212 {
213 char *v1, *v2, *op = NULL;
220 return;
221 }
222 compare = php_version_compare(v1, v2);
223 if (argc == 2) {
224 RETURN_LONG(compare);
LiveDocx.php (https://github.com/scy/val.git) PHP · 415 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: LiveDocx.php 23953 2011-05-03 05:47:39Z ralph $
21 */
78 *
79 * {code}
80 * $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
81 * array (
82 * 'username' => 'myUsername',
94 *
95 * {code}
96 * $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
97 * array (
98 * 'username' => 'myUsername',
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
95 public function resize($width, $height)
96 {
97 if (version_compare(PHP_VERSION, '5.5.0') < 0) {
98 $image = imagecreatetruecolor($width, $height);
99 imagealphablending($image, false);
148 public function crop($width, $height, $offsetX = 0, $offsetY = 0)
149 {
150 if (version_compare(PHP_VERSION, '5.5.0') < 0) {
151 $image = imagecreatetruecolor($width, $height);
152 imagealphablending($image, false);
Joomla.php (https://bitbucket.org/pastor399/newcastleunifc.git) PHP · 130 lines
1 <?php
2 /**
3 * @version $Id: Joomla.php 52337 2012-04-09 22:46:49Z btowles $
29 $this->_name = 'joomla';
30 if (self::isCurrentlyRunning()) {
31 if (version_compare(JVERSION, '1.5', '>=') && version_compare(JVERSION, '1.6', '<')) {
32 $this->populateJoomla15Info();
33 } elseif (version_compare(JVERSION, '1.6', '>=') && version_compare(JVERSION, '1.7', '<')) {
34 $this->populateJoomla16Info();
35 } elseif (version_compare(JVERSION, '1.7', '>=')) {
36 $this->populateJoomla17Info();
37 } else {
61 $app = JFactory::getApplication();
63 if (version_compare(JVERSION, '1.5.15', '<=')) {
64 $mootools_version = JFactory::getApplication()->get('MooToolsVersion', '1.11');
65 } else {
ValidatorBuilder.php (https://github.com/liuggio/symfony.git) PHP · 407 lines
1 <?php
3 /*
326 }
328 if (version_compare(PHP_VERSION, '5.3.9', '<') && $apiVersion === Validation::API_VERSION_2_5_BC) {
329 throw new InvalidArgumentException(sprintf(
330 'The Validator API that is compatible with both Symfony 2.4 '.
331 'and Symfony 2.5 can only be used on PHP 5.3.9 and higher. '.
332 'Your current PHP version is %s.',
387 if (null === $apiVersion) {
388 $apiVersion = version_compare(PHP_VERSION, '5.3.9', '<')
389 ? Validation::API_VERSION_2_4
390 : Validation::API_VERSION_2_5_BC;
options.php (https://github.com/akelos/v1.git) PHP · 366 lines
224 return false;
225 }
226 if (version_compare(phpversion(), '5') >= 0) {
227 return SimpleTestCompatibility::_isIdenticalType($first, $second);
228 }
285 */
286 function isReference(&$first, &$second) {
287 if (version_compare(phpversion(), '5', '>=')
288 && is_object($first)) {
289 return ($first === $second);
305 */
306 function isA($object, $class) {
307 if (version_compare(phpversion(), '5') >= 0) {
308 if (! class_exists($class, false)) {
309 return false;
class.debug.php (https://github.com/stonecoldtea/iona-dev.git) PHP · 228 lines
1 <?php
2 /**
3 *
18 /**
19 * PHP5 constructor
20 * Use this to build the initial form of the object, before its manipulated by methods
21 *
98 );
99 $this->debug_info[] = array(
100 'title' => "PHP Version",
101 'value' => floatval( phpversion() ),
131 $this->debug_info[] = array(
132 'title' => "PHP Safe Mode",
133 'value' => ( (bool) ini_get('safe_mode') ) ? 'Yes!':'',
134 'level' => false
options.php (https://bitbucket.org/volatileeight/prado.git) PHP · 365 lines
224 return false;
225 }
226 if (version_compare(phpversion(), '5') >= 0) {
227 return SimpleTestCompatibility::_isIdenticalType($first, $second);
228 }
285 */
286 static function isReference($first, $second) {
287 if (version_compare(phpversion(), '5', '>=')
288 && is_object($first)) {
289 return ($first === $second);
305 */
306 static function isA($object, $class) {
307 if (version_compare(phpversion(), '5') >= 0) {
308 if (! class_exists($class, false)) {
309 return false;
ShippingLabelBannerDisplayRules.php (https://gitlab.com/campus-academy/krowkaramel) PHP · 208 lines
1 <?php
2 /**
3 * WooCommerce Shipping Label Banner Display Rules.
146 */
147 private function jetpack_up_to_date() {
148 return version_compare( $this->jetpack_version, $this->min_jetpack_version, '>=' );
149 }
204 */
205 private function wcs_up_to_date() {
206 return $this->wcs_version && version_compare( $this->wcs_version, $this->min_wcs_version, '>=' );
207 }
208 }
wp-cron.php (https://gitlab.com/campus-academy/krowkaramel) PHP · 152 lines
1 <?php
2 /**
3 * A pseudo-cron daemon for scheduling WordPress tasks.
21 /* Don't make the request block till we finish, if possible. */
22 if ( function_exists( 'fastcgi_finish_request' ) && version_compare( phpversion(), '7.0.16', '>=' ) ) {
23 if ( ! headers_sent() ) {
24 header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
42 if ( ! defined( 'ABSPATH' ) ) {
43 /** Set up WordPress environment */
44 require_once __DIR__ . '/wp-load.php';
45 }
Installer.php (https://github.com/jaws-project/jaws.git) PHP · 288 lines
1 <?php
2 /**
3 * Notification Installer
134 function Upgrade($old, $new)
135 {
136 if (version_compare($old, '1.1.0', '<')) {
137 $result = $this->installSchema('1.1.0.xml', array(), '1.0.0.xml');
138 if (Jaws_Error::IsError($result)) {
147 }
149 if (version_compare($old, '1.2.0', '<')) {
150 $result = $this->installSchema('1.2.0.xml', array(), '1.1.0.xml');
151 if (Jaws_Error::IsError($result)) {
154 }
156 if (version_compare($old, '1.3.0', '<')) {
157 $result = $this->installSchema('1.3.0.xml', array(), '1.2.0.xml');
158 if (Jaws_Error::IsError($result)) {
LiveDocx.php (https://github.com/rocknoon/Stack.git) PHP · 415 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: LiveDocx.php 23775 2011-03-01 17:25:24Z ralph $
21 */
78 *
79 * {code}
80 * $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
81 * array (
82 * 'username' => 'myUsername',
94 *
95 * {code}
96 * $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
97 * array (
98 * 'username' => 'myUsername',
compatibility.php (https://github.com/cgajardo/repositorium.git) PHP · 173 lines
15 /**
16 * Creates a copy whether in PHP5 or PHP4.
17 * @param object $object Thing to copy.
18 * @return object A copy.
21 */
22 function copy($object) {
23 if (version_compare(phpversion(), '5') >= 0) {
24 eval('$copy = clone $object;');
25 return $copy;
39 */
40 function isIdentical($first, $second) {
41 if (version_compare(phpversion(), '5') >= 0) {
42 return SimpleTestCompatibility::_isIdenticalType($first, $second);
43 }
menu.php (https://github.com/livinglab/openlab.git) PHP · 166 lines
extension.php (https://github.com/mathc/joomla-cms.git) PHP · 159 lines
BulkWriteFunctionalTest.php (https://gitlab.com/vnsoftdev/sna) PHP · 308 lines
ResolvedFormTypeTest.php (https://bitbucket.org/laborautonomo/laborautonomo-site.git) PHP · 282 lines
1 <?php
3 /*
21 * @author Bernhard Schussek <bschussek@gmail.com>
22 */
23 class ResolvedFormTypeTest extends \PHPUnit_Framework_TestCase
24 {
25 /**
26 * @var \PHPUnit_Framework_MockObject_MockObject
27 */
28 private $dispatcher;
55 public function testCreateBuilder()
56 {
57 if (version_compare(\PHPUnit_Runner_Version::id(), '3.7', '<')) {
58 $this->markTestSkipped('This test requires PHPUnit 3.7.');
class-upgrade.php (https://gitlab.com/iamgraeme/royalmile) PHP · 208 lines
1 <?php
2 /**
3 * @package WPSEO
25 WPSEO_Options::maybe_set_multisite_defaults( false );
27 if ( version_compare( $this->options['version'], '1.5.0', '<' ) ) {
28 $this->upgrade_15( $this->options['version'] );
29 }
31 if ( version_compare( $this->options['version'], '2.0', '<' ) ) {
32 $this->upgrade_20();
33 }
35 if ( version_compare( $this->options['version'], '2.1', '<' ) ) {
36 $this->upgrade_21();
37 }
jcomments.legacy.php (https://bitbucket.org/dreamriks/giftjaipur.git) PHP · 108 lines
1 <?php
2 /**
3 * JComments - Joomla Comment System
24 define('JCOMMENTS_HELPERS', JCOMMENTS_BASE.'/helpers');
26 require_once (JCOMMENTS_LIBRARIES.'/joomlatune/joomla/jversion.php');
27 require_once (JCOMMENTS_LIBRARIES.'/joomlatune/joomla/jroute.php');
32 define('JCOMMENTS_BACKEND', $mosConfig_absolute_path.'/administrator/components/com_jcomments');
34 require_once (JCOMMENTS_LIBRARIES.'/joomlatune/language.php');
35 require_once (JCOMMENTS_LIBRARIES.'/joomlatune/joomla/jcache.php');
36 require_once (JCOMMENTS_LIBRARIES.'/joomlatune/joomla/jdocument.php');
37 require_once (JCOMMENTS_LIBRARIES.'/joomlatune/joomla/jdispatcher.php');
38 require_once (JCOMMENTS_LIBRARIES.'/joomlatune/joomla/jpluginhelper.php');
40 $lang = $mosConfig_lang;
SignatureFormatter.php (https://gitlab.com/judielsm/Handora) PHP · 269 lines
database-status.php (https://gitlab.com/VTTE/sitios-vtte) PHP · 371 lines
1 <?php
3 class Red_Database_Status {
62 public function needs_updating() {
63 // We need updating if we don't need to install, and the current version is less than target version
64 if ( $this->needs_installing() === false && version_compare( $this->get_current_version(), REDIRECTION_DB_VERSION, '<' ) ) {
65 return true;
66 }
113 $this->status = self::STATUS_NEED_INSTALL;
114 $this->stop_update();
115 } elseif ( count( $missing ) > 0 && version_compare( $this->get_current_version(), '2.3.3', 'ge' ) ) {
116 // Some tables are missing - try and fill them in
117 $latest->install();
126 */
127 public function does_support( $version ) {
128 return version_compare( $this->get_current_version(), $version, 'ge' );
129 }
upd.metaweblog_api.php (https://bitbucket.org/mbaily/tremain.git) PHP · 217 lines
1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2 /**
3 * ExpressionEngine - by EllisLab
182 function update($version = '')
183 {
184 if (version_compare($version, '2', '<') && ee()->db->table_exists('exp_metaweblog_api'))
185 {
186 $existing_fields = array();
204 }
206 if (version_compare($version, '2.1', '<'))
207 {
208 // nothing to see here!
216 /* End of file upd.metaweblog_api.php */
217 /* Location: ./system/expressionengine/modules/metaweblog_api/upd.metaweblog_api.php */
class-upgrade-handler.php (https://gitlab.com/lamovible/grand-regis) PHP · 162 lines
1 <?php if ( ! defined( 'ABSPATH' ) ) exit;
3 if( ! function_exists( 'nf_is_func_disabled' ) ) {
10 }
12 require_once( NF_PLUGIN_DIR . 'includes/admin/upgrades/database-migrations.php' );
13 require_once( NF_PLUGIN_DIR . 'includes/admin/upgrades/convert-forms.php' );
14 require_once( NF_PLUGIN_DIR . 'includes/admin/upgrades/convert-notifications.php' );
15 require_once( NF_PLUGIN_DIR . 'includes/admin/upgrades/convert-subs.php' );
16 require_once( NF_PLUGIN_DIR . 'includes/admin/upgrades/update-email-settings.php' );
18 /**
69 private function compare_upgrade_priority( $a, $b )
70 {
71 return version_compare( $a->priority, $b->priority );
72 }
videos_sql.php (https://bitbucket.org/pombredanne/spip-zone-treemap.git) PHP · 77 lines
1 <?php
2 if (!defined("_ECRIRE_INC_VERSION")) return;
6 if ( (!isset($GLOBALS['meta'][$nom_meta_base_version]) )
7 || (($current_version = $GLOBALS['meta'][$nom_meta_base_version])!=$version_cible)){
8 if (version_compare($current_version,'0.1','<')){
9 include_spip('base/abstract_sql');
21 ecrire_meta($nom_meta_base_version,$current_version="0.1",'non');
22 }
23 if (version_compare($current_version,'0.2','<')){
24 include_spip('base/abstract_sql');
29 ecrire_meta($nom_meta_base_version,$current_version="0.2",'non');
30 }
31 if (version_compare($current_version,'0.3','<')){
32 /* 0.1 et 0.2 rataient leurs insertions SI le plugin Mediatheque n'avait pas inséré le champ media, on relance donc l'insertion pour ceux qui ont raté le coche */
33 include_spip('base/abstract_sql');
Sql-php4.php (https://gitlab.com/mattyhead/sql-buddy) PHP · 424 lines
1 <?php
2 /*
5 http://www.sqlbuddy.com/
7 sql-php4.php
8 - sql class (php4 compatible)
218 {
219 if ($this->conn) {
220 if ($this->adapter == "mysql" && version_compare($this->getVersion(), "4.1", ">")) {
221 return true;
222 } else {
334 $output = '';
335 if ($this->conn) {
336 if ($this->adapter == "mysql" && version_compare($this->getVersion(), "5.0.0", ">=")) {
337 $this->selectDB("information_schema");
338 $schemaSql = $this->query("SELECT `SCHEMA_NAME` FROM `SCHEMATA` ORDER BY `SCHEMA_NAME`");
Dependency.php (https://github.com/robertleeplummerjr/bluebox.git) PHP · 263 lines
mocker.php (https://github.com/agallou/atoum.git) PHP · 190 lines
7 use
8 mageekguy\atoum,
9 mageekguy\atoum\php
10 ;
121 ->orphanize('__construct')
122 ->orphanize('resetCalls'),
123 php\mocker::setAdapter($adapter = new \mock\atoum\test\adapter())
124 )
125 ->then
140 {
141 $this
142 ->variable(php\mocker::setAdapter($adapter = new atoum\php\mocker\adapter()))->isNull()
143 ->object(php\mocker::getAdapter())->isIdenticalTo($adapter)
156 ->object($this->testedInstance->generate($functionName = __NAMESPACE__ . '\version_compare'))->isIdenticalTo($this->testedInstance)
157 ->boolean(function_exists($functionName))->isTrue()
158 ->boolean(version_compare('5.4.0', '5.3.0'))->isFalse()
159 ->integer(\version_compare('5.4.0', '5.3.0'))->isEqualTo(1)
DefinitionCache.php (https://gitlab.com/afzalpotenza/YII_salon) PHP · 129 lines
ValidClassNamePassTest.php (https://gitlab.com/4gdevs/online-class-record-system) PHP · 244 lines
1 <?php
3 /*
25 * @dataProvider getInvalid
26 */
27 public function testProcessInvalid($code, $php54 = false)
28 {
29 try {
32 $this->fail();
33 } catch (Exception $e) {
34 if ($php54 && version_compare(PHP_VERSION, '5.4', '<')) {
35 $this->assertInstanceOf('Psy\Exception\ParseErrorException', $e);
36 } else {
231 );
233 if (version_compare(PHP_VERSION, '5.5', '>=')) {
234 $valid[] = array('interface A {} A::class');
235 $valid[] = array('interface A {} A::CLASS');
MovableTest.php (https://github.com/devilsansclue/ZendFramework.git) PHP · 181 lines
1 <?php
2 /**
3 * Zend Framework
23 /** Zend_Memory */
24 require_once 'Zend/Memory.php';
26 /**
103 $this->assertEquals($memObject->getRef(), '012_456789');
105 if (version_compare(PHP_VERSION, '5.2') < 0) {
106 // Skip next tests for PHP versions before 5.2
159 public function testValueUpdateTracing()
160 {
161 if (version_compare(PHP_VERSION, '5.2') < 0) {
162 // Skip next tests for PHP versions before 5.2
LiveDocx.php (https://bitbucket.org/Dal-Papa/is-340-publish-base.git) PHP · 415 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: LiveDocx.php 25024 2012-07-30 15:08:15Z rob $
21 */
78 *
79 * {code}
80 * $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
81 * array (
82 * 'username' => 'myUsername',
94 *
95 * {code}
96 * $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
97 * array (
98 * 'username' => 'myUsername',
JsonView.php (https://gitlab.com/grlopez90/servipro) PHP · 175 lines
1 <?php
2 /**
3 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
4 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
5 *
9 *
10 * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
11 * @link http://cakephp.org CakePHP(tm) Project
12 * @license http://www.opensource.org/licenses/mit-license.php MIT License
49 *
50 * @package Cake.View
51 * @since CakePHP(tm) v 2.1.0
52 */
53 class JsonView extends View {
158 }
159 }
160 if (version_compare(PHP_VERSION, '5.4.0', '>=') && Configure::read('debug')) {
161 $jsonOptions = $jsonOptions | JSON_PRETTY_PRINT;
162 }
Solr.php (https://github.com/silverstripe-labs/silverstripe-fulltextsearch.git) PHP · 161 lines
ApcuBackendUnitTest.php (https://gitlab.com/geeta7/drupal) PHP · 212 lines
1 <?php
3 /**
22 * Get a list of failed requirements.
23 *
24 * This specifically bypasses checkRequirements because it fails tests. PHP 7
25 * does not have APCu and simpletest does not have a explicit "skip"
26 * functionality so to emulate it we override all test methods and explicitly
35 }
36 else {
37 if (PHP_SAPI === 'cli' && !ini_get('apc.enable_cli')) {
38 $requirements[] = 'apc.enable_cli must be enabled to run this test.';
39 }
65 */
66 protected function createCacheBackend($bin) {
67 if (version_compare(phpversion('apcu'), '5.0.0', '>=')) {
68 return new ApcuBackend($bin, $this->databasePrefix, \Drupal::service('cache_tags.invalidator.checksum'));
69 }
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
43 $engine = basename($engine);
45 require_once 'Text/Diff/Engine/' . $engine . '.php';
46 $class = 'Text_Diff_Engine_' . $engine;
47 $diff_engine = &new $class();
Html.class.php (https://github.com/wangmxf/recess.git) PHP · 192 lines
1 <?php
2 Library::import('recess.framework.AbstractHelper');
3 Library::import('recess.framework.helpers.Url');
12 * @author Kohana Team
13 * @copyright (c) 2007-2009 Kohana Team
14 * @license http://kohanaphp.com/license
15 */
16 class Html extends AbstractHelper {
34 // From PHP 5.2.3 this functionality is built-in, otherwise use a regex
35 if (version_compare(PHP_VERSION, '5.2.3', '>=')) {
36 $str = htmlspecialchars($str, ENT_QUOTES, 'UTF-8', false);
37 } else {
reflection_php5.php (https://github.com/idler/limb.git) PHP · 380 lines
4 * @package SimpleTest
5 * @subpackage UnitTester
6 * @version $Id: reflection_php5.php 7198 2008-11-01 11:57:17Z korchasa $
7 */
287 return 'function __call($method, $arguments)';
288 }
289 if (version_compare(phpversion(), '5.1.0', '>=')) {
290 if (in_array($name, array('__get', '__isset', $name == '__unset'))) {
291 return "function {$name}(\$key)";
335 $signature = '';
336 $type = $parameter->getClass();
337 if (is_null($type) && version_compare(phpversion(), '5.1.0', '>=') && $parameter->isArray()) {
338 $signature .= 'array ';
339 } elseif (!is_null($type)) {
StopwatchTask.php (https://gitlab.com/Isaki/le331.fr) PHP · 215 lines
1 <?php
2 /**
3 * $Id: 46a07222af7bd1fbfd0e39169d5f80a83c6525e1 $
20 */
22 require_once 'phing/Task.php';
24 /**
77 private function loadStopwatch()
78 {
79 if (version_compare(PHP_VERSION, '5.3.3', '<')) {
80 throw new BuildException("StopwatchTask requires at least PHP 5.3.3 installed.");
81 }
83 @include_once 'Symfony/Component/Stopwatch/autoload.php';
84 @include_once 'vendor/autoload.php';
LiveDocx.php (https://github.com/ftaiolivista/Zend-Framework-Namespaced-.git) PHP · 421 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: LiveDocx.php 23022 2010-10-05 15:30:55Z jonathan_maron $
21 */
84 *
85 * {code}
86 * $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
87 * array (
88 * 'username' => 'myUsername',
100 *
101 * {code}
102 * $phpLiveDocx = new Zend_Service_LiveDocx_MailMerge(
103 * array (
104 * 'username' => 'myUsername',
Element.php (https://github.com/jelledoornbos/magento-mirror.git) PHP · 123 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_XmlConnect
23 * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24 * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25 */
43 if (sizeof($source->children())) {
44 /**
45 * @see http://bugs.php.net/bug.php?id=41867 , fixed in 5.2.4
46 */
47 if (version_compare(phpversion(), '5.2.4', '<')===true) {
option.php (https://gitlab.com/Gashler/sg) PHP · 171 lines
13 define('ExecPhp_OPTION_WIDGET_SUPPORT', 'widget_support');
14 define('ExecPhp_OPTION_HAS_OLD_STYLE', 'exec-php_has_old_style');
15 define('ExecPhp_OPTION_IGNORE_OLD_STYLE_WARNING', 'exec-php_ignore_old_style_warning');
59 else if (version_compare($old_version, '4.4.dev') < 0)
60 $old_version = '4.4';
61 else if (version_compare($old_version, '4.5.dev') < 0)
62 $old_version = '4.5';
63 else if (version_compare($old_version, '4.6.dev') < 0)
64 $old_version = '4.6';
65 else if (version_compare($old_version, '4.7.dev') < 0)
66 $old_version = '4.7';
67 else if (version_compare($old_version, '4.8.dev') < 0)
139 $role = get_role('administrator');
140 if ($role !== NULL)
141 $role->add_cap(ExecPhp_CAPABILITY_EDIT_OTHERS_PHP);
142 }
Assert.php (https://github.com/sandsmark/owncloud.git) PHP · 384 lines
13 // +------------------------------------------------------------------------+
14 //
15 // $Id: Assert.php,v 1.25 2005/01/31 04:57:16 sebastian Exp $
16 //
21 * @author Sebastian Bergmann <sb@sebastian-bergmann.de>
22 * @copyright Copyright © 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>
23 * @license http://www.php.net/license/3_0.txt The PHP License, Version 3.0
24 * @category Testing
25 * @package PHPUnit
157 */
158 function assertSame($expected, $actual, $message = '') {
159 if (!version_compare(phpversion(), '5.0.0', '>=')) {
160 $this->fail('assertSame() only works with PHP >= 5.0.0.');
188 */
189 function assertNotSame($expected, $actual, $message = '') {
190 if (!version_compare(phpversion(), '5.0.0', '>=')) {
191 $this->fail('assertNotSame() only works with PHP >= 5.0.0.');
config-scanner.php (https://gitlab.com/Griffolion/Game-Embargo-Tracker) PHP · 155 lines
1 #!/usr/bin/php
2 <?php
4 chdir(dirname(__FILE__));
5 require_once 'common.php';
6 require_once '../library/HTMLPurifier.auto.php';
7 assertCli();
9 if (version_compare(PHP_VERSION, '5.2.2', '<')) {
10 echo "This script requires PHP 5.2.2 or later, for tokenizer line numbers.";
23 $FS = new FSTools();
24 chdir(dirname(__FILE__) . '/../library/');
25 $raw_files = $FS->globr('.', '*.php');
26 $files = array();
27 foreach ($raw_files as $file) {
AbstractLiveDocx.php (https://github.com/bruisedlee/zf2.git) PHP · 398 lines
SecurityTokenReference.php (https://github.com/Exercise/zf2.git) PHP · 175 lines
dataset_average_test.php (https://github.com/proyectoalba/alba.git) PHP · 446 lines
76 public function testCreateDatasetFromDataset3_52()
77 {
78 if ( version_compare( phpversion(), '5.2.0', '>' ) )
79 {
80 $this->markTestSkipped( "This test is only for PHP prior 5.2.1. See PHP bug #40482." );
103 public function testCreateDatasetFromDataset3()
104 {
105 if ( version_compare( phpversion(), '5.2.1', '<' ) )
106 {
107 $this->markTestSkipped( "This test is only for PHP after 5.2.1. See PHP bug #40482." );
149 public function testCreateDatasetFromDataset5_52()
150 {
151 if ( version_compare( phpversion(), '5.2.0', '>' ) )
152 {
153 $this->markTestSkipped( "This test is only for PHP prior 5.2.1. See PHP bug #40482." );
XMLParser.php (https://bitbucket.org/Nemcio/kloxo-mr.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: XMLParser.php,v 1.1.1.1 2009/05/08 18:30:19 root Exp $
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.4.9
33 * @link http://pear.php.net/package/PEAR
88 $this->_depth = 0;
90 if (version_compare(phpversion(), '5.0.0', 'lt')) {
91 if (strpos($data, 'encoding="UTF-8"')) {
92 $data = utf8_decode($data);
ComponentGrid.php (https://gitlab.com/yousafsyed/easternglamor) PHP · 263 lines
1 <?php
2 /**
3 * Copyright © 2016 Magento. All rights reserved.
11 /**
12 * Controller for component grid tasks
13 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
14 */
15 class ComponentGrid extends \Zend\Mvc\Controller\AbstractActionController
125 * @return \Zend\View\Model\JsonModel
126 * @throws \RuntimeException
127 * @SuppressWarnings(PHPMD.NPathComplexity)
128 */
129 public function componentsAction()
142 }
143 if (isset($lastSyncData['packages'][$component['name']]['latestVersion'])
144 && version_compare(
145 $lastSyncData['packages'][$component['name']]['latestVersion'],
146 $component['version'],
Diff.php (https://github.com/jarednipper/HSU-common-code.git) PHP · 372 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
43 $engine = basename($engine);
45 // require_once 'Text/Diff/Engine/' . $engine . '.php';
46 require_once 'Diff/Engine/' . $engine . '.php';
build-apidocs.php (https://github.com/doctrine/doctrine-website-sphinx.git) PHP · 127 lines
1 <?php
2 /**
3 * Use the projects.yml and build apidocs for all projects+versions
6 */
8 require_once __DIR__ . "/../vendor/autoload.php";
10 if (!isset($argv[1])) {
64 usort($tagData, function($a, $b) {
65 return version_compare($a['name'], $b['name']);
66 });
73 }),
74 function ($highestVersion, $testVersion) {
75 return version_compare($highestVersion['name'], $testVersion['name']) > 0
76 ? $highestVersion
77 : $testVersion;
class-wc-language-pack-upgrader.php (https://github.com/crowdfavorite/woocommerce.git) PHP · 231 lines
1 <?php
3 if ( ! defined( 'ABSPATH' ) ) {
81 $version = get_option( 'woocommerce_language_pack_version', array( '0', $locale ) );
83 if ( ! is_array( $version ) || version_compare( $version[0], WC_VERSION, '<' ) || $version[1] !== $locale ) {
84 if ( $this->check_if_language_pack_exists() ) {
85 $this->configure_woocommerce_upgrade_notice();
168 ) {
170 $url = wp_nonce_url( admin_url( 'admin.php?page=wc-status&tab=tools&action=translation_upgrade' ), 'language_update' );
171 $tools_url = admin_url( 'admin.php?page=wc-status&tab=tools' );
ord_order_download.php (https://gitlab.com/ptisky/API_prestashop) PHP · 197 lines
1 <?php
2 /**
3 * Store Commander
29 function multipleInvoices($invoices)
30 {
31 if (version_compare(_PS_VERSION_, '1.5.0.0', '>='))
32 {
33 $sql_in = implode(",", $invoices);
48 $dir = getcwd();
49 chdir(dirname(__FILE__).'/../../../../../m4pdf');
50 require_once('M4OrderDetail.php');
51 $invoices = array();
52 foreach($order_invoice_list as $r)
70 $dir = getcwd();
71 chdir(dirname(__FILE__).'/../../../../../m4pdf');
72 require_once('M4OrderDetail.php');
73 $_POST['submitFilterorder'] = 0;
74 $_POST['orderFilter_id_order'] = $invoices;
ClassFileLocator.php (https://gitlab.com/LisovyiEvhenii/ismextensions) PHP · 178 lines
1 <?php
2 /**
3 * Zend Framework
19 */
21 #require_once 'Zend/File/PhpClassFile.php';
23 /**
24 * Locate files containing PHP classes, interfaces, or abstracts
25 *
26 * @package Zend_File
62 // Forward-compat with PHP 5.3
63 if (version_compare(PHP_VERSION, '5.3.0', '<')) {
64 if (!defined('T_NAMESPACE')) {
65 define('T_NAMESPACE', 'namespace');
home.ctp (https://bitbucket.org/floresj/notetime.git) Unknown · 189 lines
44 else:
45 echo '<span class="notice">';
46 echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.8 or higher to use CakePHP.');
47 echo '</span>';
48 endif;
173 <ul><li><?php echo __d('cake_dev', 'Your Rapid Development Cookbook'); ?></li></ul></li>
174 <li><a href="http://api20.cakephp.org"><?php echo __d('cake_dev', 'CakePHP API'); ?> </a>
175 <ul><li><?php echo __d('cake_dev', 'Quick Reference'); ?></li></ul></li>
179 <ul><li><?php echo __d('cake_dev', 'The Show is a live and archived internet radio broadcast CakePHP-related topics and answer questions live via IRC, Skype, and telephone.'); ?></li></ul></li>
180 <li><a href="http://groups.google.com/group/cake-php"><?php echo __d('cake_dev', 'CakePHP Google Group'); ?> </a>
181 <ul><li><?php echo __d('cake_dev', 'Community mailing list'); ?></li></ul></li>
183 <ul><li><?php echo __d('cake_dev', 'Live chat about CakePHP'); ?></li></ul></li>
184 <li><a href="http://github.com/cakephp/"><?php echo __d('cake_dev', 'CakePHP Code'); ?> </a>
185 <ul><li><?php echo __d('cake_dev', 'For the Development of CakePHP Git repository, Downloads'); ?></li></ul></li>
186 <li><a href="http://cakephp.lighthouseapp.com/"><?php echo __d('cake_dev', 'CakePHP Lighthouse'); ?> </a>
187 <ul><li><?php echo __d('cake_dev', 'CakePHP Tickets, Wiki pages, Roadmap'); ?></li></ul></li>