Did anyone run CNR on PHP7?

Report bugs and errors in this forum.

Did anyone run CNR on PHP7?

Postby nam » Mon Jul 18, 2016 10:11 pm

I am not sure if our fix for PHP5.6 will be ok for PHP7. Did anyone check on 7? What is the outcome?
User avatar
nam
 
Posts: 224
Joined: Sat Dec 23, 2006 9:10 pm

Re: Did anyone run CNR on PHP7?

Postby mark99 » Tue Jul 26, 2016 12:57 pm

I've only done a public end test (I don't use CNR's cache system [too buggy] and have long since disabled the admin CP; CNR for me is just an archive of old articles), but after the 5.3 and my own 5.6 changes (as expressed elsewhere on this forum) I do find that CNR's public html output does display and I only get this error:

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; PluginSettings has a deprecated constructor in /cnr/inc/plugins.inc.php on line 211

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; XFieldsData has a deprecated constructor in /cnr/inc/plugins.inc.php on line 229

Now the fact it's a deprecated error on PHP7 means you could be lazy and simply hide all PHP errors via the mysql interface file and forget about it, but then it would probably bite you in the bum later on. You can find more about the relevant error above, here:

http://php.net/manual/en/migration70.deprecated.php

Generally it looks like a simple change of variable name to avoid the conflict, but there may be complications and so this might be useful as a guide:

https://cweiske.de/tagebuch/php4-constructors-php7.htm

I haven't tried this yet, but as I say it looks like an easy one.
mark99
 
Posts: 141
Joined: Mon Feb 09, 2009 6:01 pm

Re: Did anyone run CNR on PHP7?

Postby mark99 » Tue May 02, 2017 3:42 pm

By the way, fixing the above two errors in /cnr/inc/plugins.inc.php was as simple as doing this (old lines uncommented with // in front).

Code: Select all
class PluginSettings {
   //function PluginSettings($plugin_name) {
   function __construct($plugin_name) {


Code: Select all
class XFieldsData {
   //function XFieldsData() {
      function __construct() {


Easy.
mark99
 
Posts: 141
Joined: Mon Feb 09, 2009 6:01 pm

Re: Did anyone run CNR on PHP7?

Postby DarkSlim » Tue Oct 10, 2017 2:03 pm

Very nice, glad to see CNR can continue to this day with the latest PHP version! :)
User avatar
DarkSlim
 
Posts: 317
Joined: Thu Aug 06, 2009 4:18 pm
Location: IL


Return to Bugs and errors



Who is online

Users browsing this forum: No registered users and 1 guest

cron

x