Page 1 of 1

Create a tmp global variable ?

Posted: 04 Jul 2008, 04:41
by blueray2048
Hi, All


I just faced with an issues that is my hosting due to some php setting errors.
It miss config session.save.path so that creation of php session decline.

Suggest make a global variable $g_session_save_path to let users do a manual config
if server haven't configured it.

In config_default_inc.php or config_inc.php

Code: Select all

$g_session_save_path = '/tmp';
         
In core/session_api.php

Code: Select all

Index: session_api.php
===================================================================
--- session_api.php     (revision 20)
+++ session_api.php     (working copy)
@@ -49,6 +49,11 @@
  */
 class MantisPHPSession extends MantisSession {
        function __construct() {
+               $t_session_save_path = session_save_path();
+               if (empty($t_session_save_path))
+               {
+                       session_save_path(config_get('session_save_path'));
+               }
                session_start();
                $this->id = session_id();
        }
     
With this useful or not ?

Re: Create a tmp global variable ?

Posted: 05 Jul 2008, 04:44
by vboctor
Looks like a bug. Can you please report a bug in the bug tracker to capture this?

Re: Create a tmp global variable ?

Posted: 08 Jul 2008, 11:44
by blueray2048
OK, Thanks,

Re: Create a tmp global variable ?

Posted: 08 Jul 2008, 16:00
by vboctor
Please add a note to this thread with a bug number once you have submitted the bug. Thanks.

Re: Create a tmp global variable ?

Posted: 14 Nov 2008, 08:23
by muescha
Hi,

i think I have the same problem with the session_api.php.
I have the code inserted but then it comes a parse error:

Parse error: parse error, expecting `T_VARIABLE' or `'$'' in ~/core/session_api.php on line 54

Code: Select all


54   --- session_api.php   
55   +++ session_api.php   
56   @@ -49,6 +49,11 @@

can anybody say me what is the problem?

thx

Re: Create a tmp global variable ?

Posted: 17 Nov 2008, 14:45
by olegos
muescha, looks like you've inserted those lines into your code. That's wrong. What you insert is only the lines marked with a single '+' in the first column from that code fragment. The remaining lines are to provide context and file name to tools like "patch" to make the change automatically.