php7

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
tonnie
Regular
Posts: 13
Joined: Tue Apr 08, 2008 10:38 pm
Location: netherlands
Contact:

php7

Post by tonnie »

Hi,

I have searched for it, but cant find anything about support for php7

Does any one know if it runs under php7??

I need to know because i have to move my sites to a server that runs php7

Thanks
Vision2form webdesign & seo
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: php7

Post by onli »

I don't know of anyone having tested that. I expect it to not work at all, the evaluation changes alone (see https://www.digitalocean.com/company/bl ... for-php-7/) should make s9y and the bundled libs fail all over the place.

Hope I'm wrong. That does not look like something that is fixable without crazy maintenance work.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: php7

Post by garvinhicking »

Hi!

As for some bundled libraries, I'm afraid that could happen, too. But there I'm optimistic to be able to update to recent versions. As for the s9y core code, I do think we shouldn't have too many issues.

Having said that - I haven't tested it yet either, but it's on my list of things to try :)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: php7

Post by Timbalu »

I haven't tested it either yet, but I fell over PHP list() changes that could hit us on some places, I think.
(I just needed a place to note that somewhere to not forget about it.)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
elguenny
Regular
Posts: 5
Joined: Mon Feb 15, 2016 7:26 pm

Re: php7

Post by elguenny »

I made a test yesterday, the JS library couldn't be loaded after switching to PHP 7:
The Serendipity JavaScript-library could not be loaded. This can happen due to PHP or Plugin errors, or even a malformed browser cache. To check the exact error please open http://www.preciseassemblies.com/index. ... _editor.js manually in your browser and check for error messages.
The details are
<script>
if(typeof errorHandlerCreateDOM == "function") {
var fragment = window.top.errorHandlerCreateDOM("Error redirect: == SERENDIPITY ERROR == <p>Methods with the same name as their class will not be constructors in a future version of PHP; Cache_Lite has a deprecated constructor in /home/www/blog/bundled-libs/Cache/Lite.php on line 29</p>");
document.body.insertBefore(fragment, document.body.childNodes[0]);
}
</script>
<noscript> == SERENDIPITY ERROR == <p>Methods with the same name as their class will not be constructors in a future version of PHP; Cache_Lite has a deprecated constructor in /home/www/blog/bundled-libs/Cache/Lite.php on line 29</p></noscript>
/* Dynamically fetched templates/2k11/admin/serendipity_editor.js.tpl on 2016-02-14 20:33, called from: include/plugin_api.inc.php:external_plugin */
/* $Id$ */
/*
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
*/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: php7

Post by Timbalu »

Please unzip into /serendpity/bundled-libs directory, which overwrites the "Pear" /Cache dir
Cache.zip
Cache_lite update
(11.31 KiB) Downloaded 323 times
Maybe this just helps to get around the constructor error ... but may just loop into some other next error with PHP7... :)

Please tell us if that works well with cache lite. Pear dependencies should fit.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
elguenny
Regular
Posts: 5
Joined: Mon Feb 15, 2016 7:26 pm

Re: php7

Post by elguenny »

Didn't help ;)
<script>
if(typeof errorHandlerCreateDOM == "function") {
var fragment = window.top.errorHandlerCreateDOM("Error redirect: == SERENDIPITY ERROR == <p>Methods with the same name as their class will not be constructors in a future version of PHP; Cache_Lite has a deprecated constructor in /home/www/blog/bundled-libs/Cache/Lite.php on line 29</p>");
document.body.insertBefore(fragment, document.body.childNodes[0]);
}
</script>
<noscript> == SERENDIPITY ERROR == <p>Methods with the same name as their class will not be constructors in a future version of PHP; Cache_Lite has a deprecated constructor in /home/www/blog/bundled-libs/Cache/Lite.php on line 29</p></noscript>
/* Dynamically fetched templates/2k11/admin/serendipity_editor.js.tpl on 2016-02-15 21:37, called from: include/plugin_api.inc.php:external_plugin */
/* $Id$ */
/*
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
*/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: php7

Post by Timbalu »

Are you sure it replaced the correct file? Check the file dates. This is the last current version from PEAR.

They still seem to use the old PHP4 constructors, with the method name == class name, eg

Code: Select all

    function Cache_Lite($options = array(NULL))
which - I think - should now be

Code: Select all

   public function __construct($options = array(NULL))
I can't test this yet. Analog in the other Cache_lite files... Give it a try.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
elguenny
Regular
Posts: 5
Joined: Mon Feb 15, 2016 7:26 pm

Re: php7

Post by elguenny »

The version 1.7.16 is from 2014 and seems outdated. I changed only one line in the lite.php file and the error seems to be gone.
function Cache_Lite($options = array(NULL))
to
function __construct($options = array(NULL))
When the backend works well, all is loaded correctly?
Are there other ways to test it?
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: php7

Post by Timbalu »

elguenny wrote:When the backend works well, all is loaded correctly?
I assume so, yes.
We have some plugins making use of it I think: imagesidebar and linklist sidebar, [...] .
elguenny wrote:Are there other ways to test it?
https://github.com/pear/Cache_Lite/tree/master/tests
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Post Reply