* 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 {