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

38 lines
679 B
PHP
Raw Normal View History

2016-09-13 13:39:11 +00:00
<?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.
*/
2016-12-04 16:33:52 +00:00
public function brief(): string
2016-09-13 13:39:11 +00:00
{
return 'Purge expired sessions.';
}
/**
* Purges sessions.
*/
2016-12-04 16:33:52 +00:00
public function execute(): void
2016-09-13 13:39:11 +00:00
{
DB::table('sessions')
->where('session_expire', '<', time())
->delete();
}
}