/usr/bin/horde-sessions-gc is in php-horde 5.1.5+debian1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #!/usr/bin/env php
<?php
/**
* This script performs garbage collection on session data.
*
* Copyright 2013 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL-2). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @copyrigth 2013 Horde LLC
* @license http://www.horde.org/licenses/lgpl LGPL-2
* @package Horde
*/
$baseFile = __DIR__ . '/../lib/Application.php';
if (file_exists($baseFile)) {
require_once $baseFile;
} else {
require_once 'PEAR/Config.php';
require_once PEAR_Config::singleton()
->get('horde_dir', null, 'pear.horde.org') . '/lib/Application.php';
}
Horde_Registry::appInit('horde', array(
'authentication' => 'none',
'cli' => true
));
$parser = new Horde_Argv_Parser();
$parser->addOption('-l', '--lifetime', array(
'dest' => 'lifetime',
'help' => 'Maximum lifetime of session (in seconds)',
'type' => 'int'
));
list($values,) = $parser->parseArgs();
try {
$sh = $injector->createInstance('Horde_SessionHandler');
} catch (Exception $e) {
$cli->fatal($e);
}
$lifetime = is_null($values->lifetime)
? ini_get('session.gc_maxlifetime')
: $values->lifetime;
$sh->gc($lifetime);
$cli->message('Session garbage collection performed.', 'cli.success');
|