debug flag for sessions

This commit is contained in:
Evan Prodromou 2009-06-27 08:11:09 -07:00
parent fb84c35035
commit 871f598dcc
3 changed files with 7 additions and 2 deletions

2
README
View File

@ -1287,6 +1287,8 @@ handle: boolean. Whether we should register our own PHP session-handling
code (using the database and memcache if enabled). Defaults to false. code (using the database and memcache if enabled). Defaults to false.
Setting this to true makes some sense on large or multi-server Setting this to true makes some sense on large or multi-server
sites, but it probably won't hurt for smaller ones, either. sites, but it probably won't hurt for smaller ones, either.
debug: whether to output debugging info for session storage. Can help
with weird session bugs, sometimes. Default false.
Troubleshooting Troubleshooting
=============== ===============

View File

@ -42,8 +42,10 @@ class Session extends Memcached_DataObject
static function logdeb($msg) static function logdeb($msg)
{ {
if (common_config('sessions', 'debug')) {
common_debug("Session: " . $msg); common_debug("Session: " . $msg);
} }
}
static function open($save_path, $session_name) static function open($save_path, $session_name)
{ {

View File

@ -255,7 +255,8 @@ $config =
'search' => 'search' =>
array('type' => 'fulltext'), array('type' => 'fulltext'),
'sessions' => 'sessions' =>
array('handle' => false), // whether to handle sessions ourselves array('handle' => false, // whether to handle sessions ourselves
'debug' => false), // debugging output for sessions
); );
$config['db'] = &PEAR::getStaticProperty('DB_DataObject','options'); $config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');