Remove unneeded code from session counting script
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 11 Sep 2010 16:28:53 +0000 (10:28 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Sat, 11 Sep 2010 17:05:52 +0000 (11:05 -0600)
horde/bin/active_sessions

index e47b105..ef8ddb5 100755 (executable)
  * 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 <slusarz@horde.org>
+ * @author   Michael Slusarz <slusarz@horde.org>
+ * @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 {