[mythtv-commits] Ticket #2982: mythweb session.php

MythTV mythtv at cvs.mythtv.org
Fri Jan 26 20:47:58 UTC 2007

#2982: mythweb session.php
 Reporter:  anonymous  |        Owner:  xris    
     Type:  defect     |       Status:  reopened
 Priority:  minor      |    Milestone:  unknown 
Component:  mythweb    |      Version:  head    
 Severity:  low        |   Resolution:          
Comment (by mythtv at andrewhutchinson.net):


 I am experiencing the same problem, and updating the source from svn
 doesn't help.  I'm using the stable 0.20 branch for mythplugins, and I'm
 not entirely sure what I'm running on the MythTV side of things because I
 justed used apt-get to install it.

 Anyway, I've had a look at the code.  On line 60 in includes/session.php,
 inside function sess_write, it does:
 global $db;
 Unfortunately, after this point, $db is null.  However, under sess_read
 for example, its there.  I've tried to debug by going to the end of the
 code (modules/welcome.php, right before exit;), and print_r'ing $db there,
 and it exists.  sess_write is being called after this point though, and
 therefore I can't get any further.  I can see that
 session_set_save_handler is being used, but I'm not familiar with how this
 works and don't have the time now to look into it.  I assume that PHP is
 calling the write session function after everything is done.

 I have solved this problem by commenting out the unset on line 140 in
 includes/init.php, and then adding:
         $db = Database::connect($_SERVER['db_name'],
                                 NULL, 'mysql');
 in the place of global $db; in includes/session.php.

 I am in no way suggesting that this is a good solution, I just wanted to
 hack something together tonight to get this working.  Tomorrow I might
 have some more time to look at it.  If anyone out there wants to contact
 me about this, just send me an email.

Ticket URL: <http://svn.mythtv.org/trac/ticket/2982#comment:6>
MythTV <http://www.mythtv.org/>

More information about the mythtv-commits mailing list