| Joomla! http://forum.joomla.org/ |
|
| request for: includes/joomla.php http://forum.joomla.org/viewtopic.php?f=126&t=242580 |
Page 1 of 1 |
| Author: | sonicth [ Wed Dec 12, 2007 1:07 am ] |
| Post subject: | request for: includes/joomla.php |
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']; |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|