Joomla! Discussion Forums



It is currently Wed Nov 25, 2009 12:13 am (All times are UTC )

 




Post new topic Reply to topic  [ 1 post ] 
Author Message
Posted: Wed Dec 12, 2007 1:07 am 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sun Dec 09, 2007 9:57 pm
Posts: 6
includes/joomla.php:901,912 (or thereabouts)

is it possible to use $GLOBALS['mosCofnig_secret_var'] instead of having the whole $mainframe class for globals;

The reason for that is quite simple:
I want to get "session_id" (of session table) outside of joomla, but only including joomla.php and dont want to initialise the whole shabang!

e.g.
Code:
include ("includes/joomla.php");
//...
$GLOBALS['mosConfig_live_site'] = $mosConfig_live_site;
//...
//now i can simply do
$biscuit_name = mosMainFrame::sessionCookieName();
//...to get the session_id
$session_id = mosMainFrame::sessionCookieValue($biscuit_name);


and there is no really a good reason not to do this, $GLOBALS lay around everywhere anyway, why not in these two functions (or somewhere else for that matter)?

many thanks

sonic

here is the example patch
Code:
--- includes/joomla.php   2007-12-12 00:00:08.000000000 +0100
+++ includes/joomla.php   2007-12-12 02:04:40.000000000 +0100
@@ -899,9 +899,7 @@
   * Deperciated 1.1
   */
   function sessionCookieName() {
-      global $mainframe;
-
-      return md5( 'site' . $mainframe->getCfg( 'live_site' ) );
+      return md5( 'site' . isset($GLOBALS['mosConfig_live_site']) ? $GLOBALS['mosConfig_live_site'] : '' ) );
   }

   /*
@@ -910,9 +908,8 @@
   * Deperciated 1.1
   */
   function sessionCookieValue( $id=null ) {
-      global $mainframe;
-
-      $type       = $mainframe->getCfg( 'session_type' );
+      // get session type, 0 is the latest default
+      $type       = isset($GLOBALS['mosConfig_session_type']) ? $GLOBALS['mosConfig_session_type'] : "default";

      $browser    = @$_SERVER['HTTP_USER_AGENT'];



Top
  E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

Quick reply

 



Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group