This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/app/Console/Command/SessionPurgeCommand.php
2016-12-11 15:49:32 +01:00

37 lines
679 B
PHP

<?php
/**
* Holds the session purge command controller.
* @package Sakura
*/
namespace Sakura\Console\Command;
use CLIFramework\Command;
use Sakura\DB;
/**
* Starts up a development server.
* @package Sakura
* @author Julian van de Groep <me@flash.moe>
*/
class SessionPurgeCommand extends Command
{
/**
* A quick description of this command.
* @return string.
*/
public function brief(): string
{
return 'Purge expired sessions.';
}
/**
* Purges sessions.
*/
public function execute(): void
{
DB::table('sessions')
->where('session_expire', '<', time())
->delete();
}
}