Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Database\Console\Migrations;
4
 
5
use Illuminate\Console\Command;
6
use Illuminate\Database\Migrations\MigrationRepositoryInterface;
7
use Symfony\Component\Console\Input\InputOption;
8
 
9
class InstallCommand extends Command
10
{
11
    /**
12
     * The console command name.
13
     *
14
     * @var string
15
     */
16
    protected $name = 'migrate:install';
17
 
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Create the migration repository';
24
 
25
    /**
26
     * The repository instance.
27
     *
28
     * @var \Illuminate\Database\Migrations\MigrationRepositoryInterface
29
     */
30
    protected $repository;
31
 
32
    /**
33
     * Create a new migration install command instance.
34
     *
35
     * @param  \Illuminate\Database\Migrations\MigrationRepositoryInterface  $repository
36
     * @return void
37
     */
38
    public function __construct(MigrationRepositoryInterface $repository)
39
    {
40
        parent::__construct();
41
 
42
        $this->repository = $repository;
43
    }
44
 
45
    /**
46
     * Execute the console command.
47
     *
48
     * @return void
49
     */
50
    public function handle()
51
    {
52
        $this->repository->setSource($this->input->getOption('database'));
53
 
54
        $this->repository->createRepository();
55
 
56
        $this->components->info('Migration table created successfully.');
57
    }
58
 
59
    /**
60
     * Get the console command options.
61
     *
62
     * @return array
63
     */
64
    protected function getOptions()
65
    {
66
        return [
67
            ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use'],
68
        ];
69
    }
70
}