Updating legacy code ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I was doing well with getting things working cleanly with 7.0.x and I've actually dropped clients who's sites were still reliant on PHP5.2 rather than trying to find the time to upgrade them.

Then SUSE pushed 7.0 off the edge and 7.2 has become the stable base. So yet more things to work through. While the 'advise' may be to hide errors and warnings on production machines, THAT has been part of the problem finding edge cases in much legacy code and it IS safer to run clean or these warnings bite later. So the new warnings 7.2 is throwing up need to be cleared rather than simply pushed under the carpet. Certainly 'deprecated' errors need to be picked up, and since none of the code has been run on PHP7.1 other things need catching as well.

The one that is causing the most agro is complaints about using 'count' especially when they are being thrown in the cached templates used by Smarty and other elements of the framework. IS it now required that there is a separate check of the item being counted exists where previously it simply returned '0'? Throwing (array) in front of each just seems totally wrong, but the whole framework runs on the principle that an element is created when there is one or more values, and there being zero of those elements is flagged by it's absence in the bigger associative array. I've yet to work out just how Smarty is handling this problem and hacking the cache to add (array) quietens down the complaints ... but what is the correct way of handling this?

--
Lester Caine - G8HFL
-----------------------------
Contact - https://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - https://lsces.co.uk
EnquirySolve - https://enquirysolve.com/
Model Engineers Digital Workshop - https://medw.co.uk
Rainbow Digital Media - https://rainbowdigitalmedia.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux