From: Michael M Slusarz Date: Sat, 11 Sep 2010 16:28:53 +0000 (-0600) Subject: Remove unneeded code from session counting script X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=406a76b3bc7dfacfaefd44dec845a6d050f7dce5;p=horde.git Remove unneeded code from session counting script --- diff --git a/horde/bin/active_sessions b/horde/bin/active_sessions index e47b105a9..ef8ddb5e4 100755 --- a/horde/bin/active_sessions +++ b/horde/bin/active_sessions @@ -12,28 +12,24 @@ * See the enclosed file COPYING for license information (LGPL). If you * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html. * - * @author Michael Slusarz + * @author Michael Slusarz + * @category Horde + * @license http://www.fsf.org/copyleft/lgpl.html LGPL + * @package Horde */ require_once dirname(__FILE__) . '/../lib/Application.php'; -Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true)); +Horde_Registry::appInit('horde', array( + 'authentication' => 'none', + 'cli' => true +)); -/* Check for sessionhandler object. */ -$registry->setupSessionHandler(false); -if (!$registry->sessionHandler) { - throw new Horde_Exception('Horde is unable to load the session handler.'); +try { + $sessions = $registry->sessionHandler->getSessionsInfo(); +} catch (Horde_SessionHandler_Exception $e) { + $cli->fatal('Session counting is not supported with the current session handler.'); } -$type = !empty($conf['sessionhandler']['type']) - ? $conf['sessionhandler']['type'] - : 'builtin'; - -if ($type == 'external') { - throw new Horde_Exception('Session counting is not supported in the \'external\' SessionHandler.'); -} - -$sessions = $registry->sessionHandler->getSessionsInfo(); - if (($argc < 2) || (($argv[1] != '-l') && ($argv[1] != '-ll'))) { $cli->writeln(count($sessions)); } else {