Skip to content
Snippets Groups Projects
Commit a640a33a authored by Demian Katz's avatar Demian Katz
Browse files

Added support for help switch in expire tools.

parent dd277d84
No related merge requests found
......@@ -367,6 +367,26 @@ class UtilController extends AbstractBase
*/
public function expiresearchesAction()
{
$this->consoleOpts->addRules(
[
'h|help' => 'Get help',
]
);
if ($this->consoleOpts->getOption('h')
|| $this->consoleOpts->getOption('help')
) {
Console::writeLine('Expire old searches in the database.');
Console::writeLine('');
Console::writeLine(
'Optional parameter: the age (in days) of searches to expire;'
);
Console::writeLine(
'by default, searches more than 2 days old will be removed.'
);
return $this->getFailureResponse();
}
return $this->expire(
'Search',
'%%count%% expired searches deleted.',
......@@ -382,6 +402,26 @@ class UtilController extends AbstractBase
*/
public function expiresessionsAction()
{
$this->consoleOpts->addRules(
[
'h|help' => 'Get help',
]
);
if ($this->consoleOpts->getOption('h')
|| $this->consoleOpts->getOption('help')
) {
Console::writeLine('Expire old sessions in the database.');
Console::writeLine('');
Console::writeLine(
'Optional parameter: the age (in days) of sessions to expire;'
);
Console::writeLine(
'by default, sessions more than 2 days old will be removed.'
);
return $this->getFailureResponse();
}
return $this->expire(
'Session',
'%%count%% expired sessions deleted.',
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment