Page 1 of 1

php7

Posted: Fri Nov 06, 2015 8:29 pm
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

Re: php7

Posted: Sat Nov 07, 2015 12:44 pm
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.

Re: php7

Posted: Mon Nov 09, 2015 5:17 pm
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 :)

Re: php7

Posted: Fri Feb 12, 2016 11:23 am
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.)

Re: php7

Posted: Mon Feb 15, 2016 8:42 pm
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
*/

Re: php7

Posted: Mon Feb 15, 2016 9:19 pm
by Timbalu
Please unzip into /serendpity/bundled-libs directory, which overwrites the "Pear" /Cache dir
Cache.zip
Cache_lite update
(11.31 KiB) Downloaded 107 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.

Re: php7

Posted: Mon Feb 15, 2016 10:38 pm
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
*/

Re: php7

Posted: Tue Feb 16, 2016 11:14 am
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.

Re: php7

Posted: Tue Feb 16, 2016 8:24 pm
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?

Re: php7

Posted: Wed Feb 17, 2016 11:02 am
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