Zen Cart Logo
Forums / General Questions / Alterations to files for PHP5.4 Compatability

Alterations to files for PHP5.4 Compatability

Views: 451

Results 1 to 1 of 1
24 Feb 2014, 5:15 PM
#1
candleman avatar

candleman

Zen Follower

Join Date:
May 2008
Posts:
183
Plugin Contributions:
0

Alterations to files for PHP5.4 Compatability

My hosting company (Terranetworks) have informed me of an upcoming upgrade of PHP to version 5.4
I currently run Zencart 1.5.1 on a WINDOWS Server and have a few mods installed.

TerraNetworks have linked me to these threads to upgrade the Zencart until version 1.5.2 is fully working (Which is compatable apparently).
The issues I have are as follows.

  1. Is self explanatory so no problem
  2. Im assuming this is for Linux Servers only, does this mean that I dont have to alter these files?
  3. Having carried out all the alterations carefully and uploaded I seem to have a problem with the very last file. Includes/templates/template_default/templates/tpl_checkout_shipping_default.php
    I have a mod called Bristol Lace which has its own templates folder but this file is not in it so I have altered the one in the template default folder.
    However when uploaded the site crashes. (See below)

So my questions is, is there any way of checking if the alterations I have done make my site compatable with PHP5.4 BEFORE TerraNetworks make the switch or do I wait until they have done it to find out if my site has kicked the bucket?
for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
// set the radio button to be checked if it is the method chosen
$checked = FALSE; ** - THIS LINE IS NOT IN MY ORIGINAL FILE **

  •        if (isset($_SESSION['shipping']['id'])) { ** - THIS LINE (TO BE REMOVED) IS NOT IN MY ORIGINAL FILE **
    
  •        if (isset($_SESSION['shipping']) && isset($_SESSION['shipping']['id'])) { **- THIS LINE IS TO BE ADDED**
             $checked = ($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $_SESSION['shipping']['id']);
           }
           if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
    
  1. This is a Date/Timezone Patch (Seems ok)
    https://www.zen-cart.com/showthread.php?208662-date-timezone-patch-for-v1-5-1-1-5-0-1-3-9-on-PHP-5-3-5-4-5-5

  2. This seems to be for LINUX Installations (Do I then Ignore this for Windows?)
    https://www.zen-cart.com/showthread.php?207435-php-5-4-fatal-error-Allowed-memory-size-of-83886080-bytes-exhausted/page2

https://github.com/zencart/zencart/commit/8f47bc47bdf6c8a189f51d00e26deb80026d2886#diff-d0cfabf36e35050435a71e593f272f08R148

  1. Changing SESSION['shipping'] to an array (Way over my head)
    https://www.zen-cart.com/showthread.php?202319-PHP-5-4-warnings-Illegal-string-offset/page2

https://github.com/zencart/zencart/commit/274f4857062bd6df6cc73286272cb78fc86946c9#diff-c781cc3201e721c578c758155e157016R184