This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:php7 [2016/01/28 08:04] wvdkuil [JpGraph] |
en:php7 [2016/01/28 16:33] (current) wvdkuil [JpGraph] |
||
---|---|---|---|
Line 3: | Line 3: | ||
This page is a collection of questions / solutions for PHP7 implementation | This page is a collection of questions / solutions for PHP7 implementation | ||
- | ===== General ===== | + | ===== Open problems ===== |
- | * none yet | + | * none at 2016-01-26 |
===== JpGraph ===== | ===== JpGraph ===== | ||
The code to check the PHP version should be changed so that version 7.0 is accepted.\\ | The code to check the PHP version should be changed so that version 7.0 is accepted.\\ | ||
- | * Script **jpgraph.php** lines 230-242 | + | * Script weather28/jpgraph/src/**jpgraph.php** |
+ | * lines 230-242 | ||
* function **CheckPHPVersion** | * function **CheckPHPVersion** | ||
* add the extra line | * add the extra line | ||
Line 24: | Line 25: | ||
return true; | return true; | ||
}</code> | }</code> | ||
+ | |||
+ | As debug options are set to high when testing the template, switch them off for the graphs at | ||
+ | * Script weather28/wxgraphs/**graphsconf.php** | ||
+ | * lines 29 | ||
+ | * function **fetch_root** | ||
+ | * add the extra line after the include of uor template settings files | ||
+ | <code> include '../wsLoadSettings.php'; // NEXT line added for PHP7 | ||
+ | ini_set('display_errors', NULL); error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); | ||
+ | </code> | ||
+ | <WRAP center round info 80%> | ||
+ | Setting the debug options on will reveal other deprecated messages. They are not real errors, only messages that in the future these "old ways of doing things" need to be redone the modern way. But for now the graphs are correctly drawn. | ||
+ | </WRAP> | ||
+ | |||
+ | |||
+ | ===== WU history ===== | ||
+ | |||
+ | In one case the ereg_replace function is used. It should be replaced with a str_replace | ||
+ | * Script weather28/wu/**WU-history.php** | ||
+ | * lines 1406 | ||
+ | * function **getcsvWithoutHanging** | ||
+ | * change that line from | ||
+ | <code>$line = ereg_replace("<br>", "", fgets($socketConnection, 4096)); //One of these gets left in there somehow</code> to | ||
+ | <code>$line = str_replace("<br>", "", fgets($socketConnection, 4096)); //One of these gets left in there somehow</code> | ||
+ |