Create a tmp global variable ?

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
blueray2048
Posts: 16
Joined: 04 Oct 2006, 08:48

Create a tmp global variable ?

Post 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 ?
vboctor
Site Admin
Posts: 1304
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Re: Create a tmp global variable ?

Post by vboctor »

Looks like a bug. Can you please report a bug in the bug tracker to capture this?
Migrate your MantisBT to the MantisHub Cloud
blueray2048
Posts: 16
Joined: 04 Oct 2006, 08:48

Re: Create a tmp global variable ?

Post by blueray2048 »

OK, Thanks,
vboctor
Site Admin
Posts: 1304
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Re: Create a tmp global variable ?

Post by vboctor »

Please add a note to this thread with a bug number once you have submitted the bug. Thanks.
Migrate your MantisBT to the MantisHub Cloud
muescha
Posts: 3
Joined: 12 Nov 2008, 13:24

Re: Create a tmp global variable ?

Post 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
olegos
Posts: 72
Joined: 12 Mar 2007, 20:24

Re: Create a tmp global variable ?

Post 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.
Post Reply