Skip to content

Commit

Permalink
These comparisons won't work with PHP7.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Feb 3, 2015
1 parent 5d564db commit d01e78b
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion framework/ActiveSync/lib/Horde/ActiveSync/Timezone.php
Expand Up @@ -79,7 +79,7 @@ class Horde_ActiveSync_Timezone
*/
public static function getOffsetsFromSyncTZ($data)
{
if (PHP_MINOR_VERSION >= 5) {
if (version_compare(PHP_VERSION, '5.5', '>=')) {
$format = 'lbias/Z64stdname/vstdyear/vstdmonth/vstdday/vstdweek/vstdhour/vstdminute/vstdsecond/vstdmillis/'
. 'lstdbias/Z64dstname/vdstyear/vdstmonth/vdstday/vdstweek/vdsthour/vdstminute/vdstsecond/vdstmillis/'
. 'ldstbias';
Expand Down
2 changes: 1 addition & 1 deletion framework/Compress/lib/Horde/Compress/Dbx.php
Expand Up @@ -122,7 +122,7 @@ protected function _readMessage($data, $position)
if (strlen($s) == 0) {
break;
}
if (PHP_MINOR_VERSION >= 5) {
if (version_compare(PHP_VERSION, '5.5', '>=')) {
$msg_item = unpack('LFilePos/LUnknown/LItemSize/LNextItem/Z512Content', $s);
} else {
$msg_item = unpack('LFilePos/LUnknown/LItemSize/LNextItem/a512Content', $s);
Expand Down
2 changes: 1 addition & 1 deletion framework/Compress/lib/Horde/Compress/Tar.php
Expand Up @@ -71,7 +71,7 @@ public function decompress($data, array $params = array())
$return_array = array();

while ($position < $data_len) {
if (PHP_MINOR_VERSION >= 5) {
if (version_compare(PHP_VERSION, '5.5', '>=')) {
$info = @unpack('Z100filename/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/Z8checksum/Ctypeflag/Z100link/Z6magic/Z2version/Z32uname/Z32gname/Z8devmajor/Z8devminor', substr($data, $position));
} else {
$info = @unpack('a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/Ctypeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', substr($data, $position));
Expand Down
2 changes: 1 addition & 1 deletion framework/Core/lib/Horde/Script/Cache/File.php
Expand Up @@ -95,7 +95,7 @@ protected function _process($scripts)
* publicly accessible key and we want to guarantee filename
* is unique. */
$sig = hash(
(PHP_MINOR_VERSION >= 4) ? 'fnv164' : 'sha1',
(version_compare(PHP_VERSION, '5.4', '>=')) ? 'fnv164' : 'sha1',
json_encode($hashes) . $mtime
);

Expand Down
2 changes: 1 addition & 1 deletion framework/Core/lib/Horde/Script/Cache/HordeCache.php
Expand Up @@ -50,7 +50,7 @@ protected function _process($scripts)
sort($hashes);

$sig = hash(
(PHP_MINOR_VERSION >= 4) ? 'fnv164' : 'sha1',
(version_compare(PHP_VERSION, '5.4', '>=')) ? 'fnv164' : 'sha1',
json_encode($hashes) . $mtime
);

Expand Down
2 changes: 1 addition & 1 deletion framework/Core/lib/Horde/Themes/Css/Cache/File.php
Expand Up @@ -39,7 +39,7 @@ public function process($css, $cacheid)
/* Use 64-bit FNV algo (instead of 32-bit) since this is a
* publicly accessible key and we want to guarantee filename
* is unique. */
(PHP_MINOR_VERSION >= 4) ? 'fnv164' : 'sha1',
(version_compare(PHP_VERSION, '5.4', '>=')) ? 'fnv164' : 'sha1',
json_encode($css) . $cacheid
);
$filename = $sig . '.css';
Expand Down
2 changes: 1 addition & 1 deletion framework/Core/lib/Horde/Themes/Css/Cache/HordeCache.php
Expand Up @@ -40,7 +40,7 @@ public function process($css, $cacheid)
/* Use 64-bit FNV algo (instead of 32-bit) since this is a
* publicly accessible key and we want to guarantee filename
* is unique. */
(PHP_MINOR_VERSION >= 4) ? 'fnv164' : 'sha1',
(version_compare(PHP_VERSION, '5.4', '>=')) ? 'fnv164' : 'sha1',
json_encode($css) . $cacheid
);

Expand Down
2 changes: 1 addition & 1 deletion framework/Db/lib/Horde/Db/Adapter/Base.php
Expand Up @@ -830,7 +830,7 @@ protected function _formatLogEntry($message, $sql)
protected function _cacheKey($key)
{
if (!isset($this->_cachePrefix)) {
$this->_cachePrefix = get_class($this) . hash((PHP_MINOR_VERSION >= 4) ? 'fnv132' : 'sha1', serialize($this->_config));
$this->_cachePrefix = get_class($this) . hash((version_compare(PHP_VERSION, '5.4', '>=')) ? 'fnv132' : 'sha1', serialize($this->_config));
}

return $this->_cachePrefix . $key;
Expand Down
2 changes: 1 addition & 1 deletion framework/Imap_Client/lib/Horde/Imap/Client/DateTime.php
Expand Up @@ -29,7 +29,7 @@ class Horde_Imap_Client_DateTime extends DateTime
public function __construct($time = null, $tz = null)
{
/* See https://bugs.php.net/bug.php?id=67118 */
$bug_67118 = (PHP_MINOR_VERSION >= 6) ||
$bug_67118 = (version_compare(PHP_VERSION, '5.6', '>=')) ||
in_array(PHP_VERSION, array('5.4.29', '5.5.13'));
$tz = new DateTimeZone('UTC');

Expand Down
2 changes: 1 addition & 1 deletion framework/Mapi/lib/Horde/Mapi/Timezone.php
Expand Up @@ -70,7 +70,7 @@ class Horde_Mapi_Timezone
*/
public static function getOffsetsFromSyncTZ($data)
{
if (PHP_MINOR_VERSION >= 5) {
if (version_compare(PHP_VERSION, '5.5', '>=')) {
$format = 'lbias/Z64stdname/vstdyear/vstdmonth/vstdday/vstdweek/vstdhour/vstdminute/vstdsecond/vstdmillis/'
. 'lstdbias/Z64dstname/vdstyear/vdstmonth/vdstday/vdstweek/vdsthour/vdstminute/vdstsecond/vdstmillis/'
. 'ldstbias';
Expand Down
2 changes: 1 addition & 1 deletion framework/Util/lib/Horde/Domhtml.php
Expand Up @@ -248,7 +248,7 @@ public function getCharset()
*/
protected function _loadHTML($html)
{
if (PHP_MINOR_VERSION >= 4) {
if (version_compare(PHP_VERSION, '5.4', '>=')) {
$mask = defined('LIBXML_PARSEHUGE')
? LIBXML_PARSEHUGE
: 0;
Expand Down
2 changes: 1 addition & 1 deletion horde/lib/core.php
Expand Up @@ -20,7 +20,7 @@
ini_set('tidy.clean_output', 0);

// TODO: Removed from PHP as of 5.4.0
if (PHP_MINOR_VERSION < 4) {
if (version_compare(PHP_VERSION, '5.4', '<')) {
ini_set('magic_quotes_runtime', 0);
ini_set('magic_quotes_sybase', 0);
}
Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Dynamic/Base.php
Expand Up @@ -134,7 +134,7 @@ protected function _addBaseVars()
// Other variables
'disable_compose' => !IMP_Compose::canCompose(),
'pref_prefix' => hash(
(PHP_MINOR_VERSION >= 4) ? 'fnv132' : 'sha1',
(version_compare(PHP_VERSION, '5.4', '>=')) ? 'fnv132' : 'sha1',
$registry->getAuth() . '|' . $_SERVER['SERVER_NAME']
)
));
Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Flag/User.php
Expand Up @@ -81,7 +81,7 @@ public function __set($name, $value)
* of original string as flag. */
if (!strlen($imapflag)) {
$imapflag = hash(
(PHP_MINOR_VERSION >= 4) ? 'fnv132' : 'md5',
(version_compare(PHP_VERSION, '5.4', '>=')) ? 'fnv132' : 'md5',
$value
);
}
Expand Down

0 comments on commit d01e78b

Please sign in to comment.