There is a code fragment in /okapi/services/caches/map/TileTree.php:
|
try { |
|
list($z21x, $z21y) = self::latlon_to_z21xy($lat, $lon); |
|
} catch (Exception $e) { |
|
/* E.g. division by zero, if the cache is placed at the north pole. */ |
|
return false; |
|
} |
When the "division by zero" problem occurs:
- in PHP 5.6 only a warning is generated, no exception is thrown, evaluation of the code continues as in any non-exceptionable case (probably with
$z21y value set to INF)
- in PHP 7+ a
DivisionByZeroError is generated, but it is not caught by above try...catch block, because this error extends Error not Exception. In result a service call throws genericError and does not end correctly
The easiest solution should be to use Throwable instead of Exception but Throwable was added in PHP 7.0 which does not comply with okapi requirement of PHP >= 5.6.
However, is there any okapi server still running on PHP 5.6? Shouldn't the required version be changed to f.ex. 7.0+ ?
There is a code fragment in
/okapi/services/caches/map/TileTree.php:okapi/okapi/services/caches/map/TileTree.php
Lines 279 to 284 in 3aab571
When the "division by zero" problem occurs:
$z21yvalue set to INF)DivisionByZeroErroris generated, but it is not caught by abovetry...catchblock, because this error extendsErrornotException. In result a service call throws genericError and does not end correctlyThe easiest solution should be to use
Throwableinstead ofExceptionbutThrowablewas added in PHP 7.0 which does not comply with okapi requirement of PHP >= 5.6.However, is there any okapi server still running on PHP 5.6? Shouldn't the required version be changed to f.ex. 7.0+ ?