expressolivretools / app / Console / Commands / Expresso / CyrusCredentialFile.php @ ab2f5151
Histórico | Ver | Anotar | Baixar (1,12 KB)
1 | ab2f5151 | Alexandre Correia | <?php
|
---|---|---|---|
2 | |||
3 | namespace App\Console\Commands\Expresso; |
||
4 | |||
5 | use Illuminate\Console\Command; |
||
6 | use Illuminate\Support\Facades\DB; |
||
7 | use Illuminate\Support\Facades\File; |
||
8 | |||
9 | class CyrusCredentialFile extends Command |
||
10 | { |
||
11 | /**
|
||
12 | * The name and signature of the console command.
|
||
13 | *
|
||
14 | * @var string
|
||
15 | */
|
||
16 | protected $signature = 'expresso:get-cyrus-credentials'; |
||
17 | |||
18 | /**
|
||
19 | * The console command description.
|
||
20 | *
|
||
21 | * @var string
|
||
22 | */
|
||
23 | protected $description = 'lista credenciais do cyrus'; |
||
24 | |||
25 | /**
|
||
26 | * Create a new command instance.
|
||
27 | *
|
||
28 | * @return void
|
||
29 | */
|
||
30 | public function __construct() |
||
31 | { |
||
32 | parent::__construct();
|
||
33 | } |
||
34 | |||
35 | /**
|
||
36 | * Execute the console command.
|
||
37 | *
|
||
38 | * @return mixed
|
||
39 | */
|
||
40 | public function handle() |
||
41 | { |
||
42 | $configEAdmin = DB::connection('pgsql-expresso')->table('phpgw_emailadmin') |
||
43 | ->where('description', env('KEY_EMAILADMIN_SOGO') ) |
||
44 | ->first(); |
||
45 | |||
46 | File::put( 'credential', $configEAdmin->imapadminusername . ":" . $configEAdmin->imapadminpw ); |
||
47 | |||
48 | $this->info( 'Arquivo de credenciais cyrus criado com sucesso' ); |
||
49 | } |
||
50 | |||
51 | } |