Skip to content

Commit 6bdcc28

Browse files
spinschFlyingmana
andauthored
Change lowest PHP version to 7 (OpenMage#1255)
Co-authored-by: Daniel Fahlke <flyingmana@googlemail.com>
1 parent 9d0cb18 commit 6bdcc28

File tree

10 files changed

+17
-51
lines changed

10 files changed

+17
-51
lines changed

api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
2525
*/
2626

27-
if (version_compare(phpversion(), '5.2.0', '<')) {
28-
echo 'It looks like you have an invalid PHP version. Magento supports PHP 5.2.0 or newer';
27+
if (version_compare(phpversion(), '7.0.0', '<')===true) {
28+
echo 'It looks like you have an invalid PHP version. Magento supports PHP 7.0.0 or newer';
2929
exit;
3030
}
3131

app/code/core/Mage/Authorizenet/Model/Directpost/Request.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,13 @@ protected function _setTransactionKey($transKey)
7878
*/
7979
public function generateRequestSign($merchantApiLoginId, $merchantTransactionKey, $amount, $currencyCode, $fpSequence, $fpTimestamp)
8080
{
81-
if (phpversion() >= '5.1.2') {
82-
return hash_hmac("md5",
83-
$merchantApiLoginId . '^' .
84-
$fpSequence . '^' .
85-
$fpTimestamp . '^' .
86-
$amount . '^' .
87-
$currencyCode, $merchantTransactionKey
88-
);
89-
}
90-
91-
return bin2hex(mhash(MHASH_MD5,
81+
return hash_hmac("md5",
9282
$merchantApiLoginId . '^' .
9383
$fpSequence . '^' .
9484
$fpTimestamp . '^' .
9585
$amount . '^' .
9686
$currencyCode, $merchantTransactionKey
97-
));
87+
);
9888
}
9989

10090
/**

get.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
2424
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
2525
*/
26-
if (version_compare(phpversion(), '5.2.0', '<')===true) {
26+
if (version_compare(phpversion(), '7.0.0', '<')===true) {
2727
echo '<div style="font:12px/1.35em arial, helvetica, sans-serif;"><div style="margin:0 0 25px 0; '
2828
. 'border-bottom:1px solid #ccc;"><h3 style="margin:0; font-size:1.7em; font-weight:normal; '
2929
. 'text-transform:none; text-align:left; color:#2f2f2f;">Whoops, it looks like you have an invalid PHP version.'
30-
. '</h3></div><p>Magento supports PHP 5.2.0 or newer. <a href="https://www.openmage.org/magento-lts/install.html" '
30+
31+
. '</h3></div><p>Magento supports PHP 7.0.0 or newer. <a href="https://www.openmage.org/magento-lts/install.html" '
3132
. 'target="">Find out</a> how to install</a> Magento using PHP-CGI as a work-around.</p></div>';
3233
exit;
3334
}

index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
2525
*/
2626

27-
if (version_compare(phpversion(), '5.3.0', '<')===true) {
27+
if (version_compare(phpversion(), '7.0.0', '<')===true) {
2828
echo '<div style="font:12px/1.35em arial, helvetica, sans-serif;">
2929
<div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;">
3030
<h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">
31-
Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 5.3.0 or newer.
31+
Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 7.0.0 or newer.
3232
<a href="https://www.openmage.org/magento-lts/install.html" target="">Find out</a> how to install</a>
3333
Magento using PHP-CGI as a work-around.</p></div>';
3434
exit;

index.php.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
2525
*/
2626

27-
if (version_compare(phpversion(), '5.2.0', '<')===true) {
28-
echo '<div style="font:12px/1.35em arial, helvetica, sans-serif;"><div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;"><h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 5.2.0 or newer. <a href="https://www.openmage.org/magento-lts/install.html" target="">Find out</a> how to install</a> Magento using PHP-CGI as a work-around.</p></div>';
27+
if (version_compare(phpversion(), '7.0.0', '<')===true) {
28+
echo '<div style="font:12px/1.35em arial, helvetica, sans-serif;"><div style="margin:0 0 25px 0; border-bottom:1px solid #ccc;"><h3 style="margin:0; font-size:1.7em; font-weight:normal; text-transform:none; text-align:left; color:#2f2f2f;">Whoops, it looks like you have an invalid PHP version.</h3></div><p>Magento supports PHP 7.0.0 or newer. <a href="https://www.openmage.org/magento-lts/install.html" target="">Find out</a> how to install</a> Magento using PHP-CGI as a work-around.</p></div>';
2929
exit;
3030
}
3131

install.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@
118118
*
119119
*/
120120

121-
if (version_compare(phpversion(), '5.2.0', '<')===true) {
122-
die('ERROR: Whoops, it looks like you have an invalid PHP version. Magento supports PHP 5.2.0 or newer.');
121+
if (version_compare(phpversion(), '7.0.0', '<')===true) {
122+
die('ERROR: Whoops, it looks like you have an invalid PHP version. Magento supports PHP 7.0.0 or newer.');
123123
}
124124
set_include_path(dirname(__FILE__) . PATH_SEPARATOR . get_include_path());
125125
require 'app/bootstrap.php';

lib/Mage/Archive/Tar.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ protected function _initWriter()
103103
*/
104104
protected static final function _getFormatParseHeader()
105105
{
106-
if (version_compare(phpversion(), '5.5.0', '<') === true) {
107-
return 'a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2version/'
108-
. 'a32uname/a32gname/a8devmajor/a8devminor/a155prefix/a12closer';
109-
}
110106
return 'Z100name/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/Z8checksum/Z1type/Z100symlink/Z6magic/Z2version/'
111107
. 'Z32uname/Z32gname/Z8devmajor/Z8devminor/Z155prefix/Z12closer';
112108
}

lib/Varien/Simplexml/Element.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -345,16 +345,7 @@ public function xmlentities($value = null)
345345
public function appendChild($source)
346346
{
347347
if ($source->children()) {
348-
/**
349-
* @see http://bugs.php.net/bug.php?id=41867 , fixed in 5.2.4
350-
*/
351-
if (version_compare(phpversion(), '5.2.4', '<')===true) {
352-
$name = $source->children()->getName();
353-
}
354-
else {
355-
$name = $source->getName();
356-
}
357-
$child = $this->addChild($name);
348+
$child = $this->addChild($source->getName());
358349
} else {
359350
$child = $this->addChild($source->getName(), $this->xmlentities($source));
360351
}
@@ -477,13 +468,7 @@ public function setNode($path, $value, $overwrite=true)
477468
$xml->addChild($nodeName, $xml->xmlentities($value));
478469
*/
479470
if (!isset($node->$nodeName) || $overwrite) {
480-
// http://bugs.php.net/bug.php?id=36795
481-
// comment on [8 Feb 8:09pm UTC]
482-
if (isset($node->$nodeName) && (version_compare(phpversion(), '5.2.6', '<')===true)) {
483-
$node->$nodeName = $node->xmlentities($value);
484-
} else {
485-
$node->$nodeName = $value;
486-
}
471+
$node->$nodeName = $value;
487472
}
488473
} else {
489474
if (!isset($node->$nodeName)) {

lib/Zend/Http/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public function __construct($uri = null, $config = null)
293293
$this->setConfig($config);
294294
}
295295

296-
$this->_queryBracketsEscaped = version_compare(phpversion(), '5.1.3', '>=');
296+
$this->_queryBracketsEscaped = true;
297297
}
298298

299299
/**

lib/Zend/Pdf/StringParser.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,7 @@ public function readLexeme()
264264
}
265265
} else {
266266
$start = $this->offset;
267-
$compare = '';
268-
if( version_compare( phpversion(), '5.2.5' ) >= 0) {
269-
$compare = "()<>[]{}/%\x00\t\n\f\r ";
270-
} else {
271-
$compare = "()<>[]{}/%\x00\t\n\r ";
272-
}
273-
267+
$compare = "()<>[]{}/%\x00\t\n\r ";
274268
$this->offset += strcspn($this->data, $compare, $this->offset);
275269

276270
return substr($this->data, $start, $this->offset - $start);

0 commit comments

Comments
 (0)