Skip to content

Commit be831e1

Browse files
author
Luca Degasperi
committed
Starting to develop some commands
1 parent a1c0821 commit be831e1

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php namespace LucaDegasperi\OAuth2Server\Commands;
2+
3+
use Illuminate\Console\Command;
4+
use Symfony\Component\Console\Input\InputOption;
5+
use Symfony\Component\Console\Input\InputArgument;
6+
7+
class ExpiredTokensCommand extends Command
8+
{
9+
10+
/**
11+
* The console command name.
12+
*
13+
* @var string
14+
*/
15+
protected $name = 'oauth:expired-tokens';
16+
17+
/**
18+
* The console command description.
19+
*
20+
* @var string
21+
*/
22+
protected $description = 'A command to delete the OAuth expired tokens';
23+
24+
/**
25+
* Create a new command instance.
26+
*
27+
* @return void
28+
*/
29+
public function __construct()
30+
{
31+
parent::__construct();
32+
}
33+
34+
/**
35+
* Execute the console command.
36+
*
37+
* @return void
38+
*/
39+
public function fire()
40+
{
41+
//
42+
var_dump('fails');
43+
}
44+
45+
/**
46+
* Get the console command arguments.
47+
*
48+
* @return array
49+
*/
50+
protected function getArguments()
51+
{
52+
return array();
53+
}
54+
55+
/**
56+
* Get the console command options.
57+
*
58+
* @return array
59+
*/
60+
protected function getOptions()
61+
{
62+
return array(
63+
array('delete', null, InputOption::VALUE_NONE, 'Effectively delete the tokens', null),
64+
);
65+
}
66+
67+
}

src/LucaDegasperi/OAuth2Server/OAuth2ServerServiceProvider.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ public function register()
8686
return $server;
8787

8888
});
89+
90+
$app['oauth2.expired-tokens-command'] = $app->share(function($app)
91+
{
92+
return new Commands\ExpiredTokensCommand();
93+
});
94+
95+
$this->commands('oauth2.expired-tokens-command');
8996
}
9097

9198
/**

0 commit comments

Comments
 (0)