Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
621 lars 1
<?php
2
 
3
namespace Laravel\Sail\Console;
4
 
5
use Illuminate\Console\Command;
6
use Laravel\Sail\Console\Concerns\InteractsWithDockerComposeServices;
7
 
8
class AddCommand extends Command
9
{
10
    use InteractsWithDockerComposeServices;
11
 
12
    /**
13
     * The name and signature of the console command.
14
     *
15
     * @var string
16
     */
17
    protected $signature = 'sail:add
18
        {services? : The services that should be added}
19
    ';
20
 
21
    /**
22
     * The console command description.
23
     *
24
     * @var string
25
     */
26
    protected $description = 'Add a service to an existing Sail installation';
27
 
28
    /**
29
     * Execute the console command.
30
     *
31
     * @return int|null
32
     */
33
    public function handle()
34
    {
35
        if ($this->argument('services')) {
36
            $services = $this->argument('services') == 'none' ? [] : explode(',', $this->argument('services'));
37
        } elseif ($this->option('no-interaction')) {
38
            $services = $this->defaultServices;
39
        } else {
40
            $services = $this->gatherServicesWithSymfonyMenu();
41
        }
42
 
43
        if ($invalidServices = array_diff($services, $this->services)) {
44
            $this->error('Invalid services ['.implode(',', $invalidServices).'].');
45
 
46
            return 1;
47
        }
48
 
49
        $this->buildDockerCompose($services);
50
        $this->replaceEnvVariables($services);
51
        $this->configurePhpUnit();
52
 
53
        $this->info('Additional Sail services installed successfully.');
54
 
55
        $this->prepareInstallation($services);
56
    }
57
}