Details
-
Task
-
Resolution: Done
-
None
-
None
-
Empty show more show less
Description
Zugesagte Umsetzung bis Mitte Februar
According to the PHP Manual we have to do the following things to enable translate5 for PHP 7:
check usage of set_exception_handlers when a Error is thrown (not existing in translate5 code, only in Zend)find indirect variable access usage, since evaluation order changes, the affected expressions can be grepped for, see the corresponding section in the php change logcheck list() usagegrep in the code for hexadecimal numbers as string, since they are not considered as numeric any moregrep for the as removed marked methodscheck in ini files for # comments, they are not possible any more (use ; instead)ensure that our previously implemented own type declarations for int / bool / string etc are valid. For example our "integer" must be converted to int. See list inhttp://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration- Zend: we should switch to
Zend 1.12.12, seeZend DocuZF1.12.20our own fork of ZF1: https://github.com/MittagQI/zf1-php7.3 - ThirdParty: check for updates (see https://jira.translate5.net/browse/TRANSLATE-1593 )
See if this causes problems somewhere and handle it then:
- JSON: json_decode ends up in an JSON error if the given string is an empty string. Evaluate all places and avoid empty strings or pretend then the json_decode call. Found out in using the tests on a PHP7 installation.
- foreach usages:
- at least the new behaviour that foreach iterates over a copy in default by-value mode will lead to errors!
- the self changing foreach in on reference mode can be problem in our different parsers in the project
The following changes could affect us too:
Since many (fatal) errors are converted to exceptions, it is possible that the error based checkmode on import could not work any more. This must be tested.mssql is removed in favour of the sqlsrv extension
New Features:
- parameter and return type declarations, which we should use in future. Some Details has to be discussed / researched before:
- is default = null working for parameters (also null directly). Not all places can just be converted, since sometimes we expect mixed values, same for return values.
- Anonymous classes
- arrays as const / define
Null coalescing operator- spaceship operator
- preg_replace_callback_array
- ... Operator (already in PHP 5.6)
Other problems / todos resulting on the PHP7 update:
Since for TRANSLATE-1421 most parts of the application has to be tested manually, TRANSLATE-1421 should be implemented along with the PHP7 update.
Also this task includes to switch the usage of PHPExcel to PHPSpreadsheet (the successor of PHPExcel) since PHPExcel does not support PHP7.1
For Zend Framework 1: To me it is currently unclear, if it still runs under PHP 7.2 without errors. See these threads:
https://stackoverflow.com/questions/49072332/is-zend-framework-1-compatible-with-php-7-2https://stackoverflow.com/questions/35500872/which-version-of-zend-framework-1-is-compatible-with-php7/35505427#35505427https://discourse.zendframework.com/t/zf1-community-maintained-official-fork/419/36
Also there are forks with the goal to further support ZF 1 with new PHP versions:
https://github.com/diablomedia/zf1https://github.com/magento/zf1 (more Magento specific)https://github.com/Shardj/zf1-php7.2= used for our own fork: https://github.com/MittagQI/zf1-php7.3
Attachments
Issue Links
- blocks
-
TRANSLATE-1421 Unable to save segment with term content '0'
- Done
-
TRANSLATE-337 uniqid should not be used for security relevant issues
- Done
-
TRANSLATE-1593 ThirdParty: check for updates after migration to PHP7.3
- Done