Re: Deprecated function PHP 5.4+: session _register

Markus Hoenicka <[email protected]> Tue, 01 Sep 2015 23:06:11 +0200
Newsgroups gmane.text.refdb.general
Message-ID <[email protected]>
At 2015-08-31 03:33, MK was heard to say:
> Hi,
> I'm using PHP 5.6 and received some errors regarding a deprecated
> function (session_register). I was able to fix these by adding some
> code to index.php. (Code from php.net):
> http://www.php.net/manual/en/function.session-register.php
> 
> 
> index.php:
> ----
> $_SESSION["refdbc"]="/usr/local/bin/refdbc";
> $_SESSION["refdba"]="/usr/local/bin/refdba";
> $_SESSION["path"]="/usr/local/bin";
> $refdbc=$_SESSION["refdbc"];
> $refdba=$_SESSION["refdba"];
> 
> // Fix for removed Session functions
> function fix_session_register(){
>     function session_register(){
>         $args = func_get_args();
>         foreach ($args as $key){
>             $_SESSION[$key]=$GLOBALS[$key];
>         }
>     }
>     function session_is_registered($key){
>         return isset($_SESSION[$key]);
>     }
>     function session_unregister($key){
>         unset($_SESSION[$key]);
>     }
> }
> if (!function_exists('session_register')) fix_session_register();
> ----
> 

Hi,

thanks for this and the previous reports. Apparently there were a couple 
of backwards-incompatible changes in PHP 5.6 which broke a few things in 
the web frontend. I do not use the frontend myself, but I appreciate 
your attempts at fixing the problems. I'll add your fixes to the svn 
code as soon as time permits.

best regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38


------------------------------------------------------------------------------