Yaffs site version 1.1
[yaffs-website] / vendor / drupal / console / src / Command / Shared / DatabaseTrait.php
1 <?php
2
3 /**
4  * @file
5  * Contains Drupal\Console\Command\Shared\DatabaseTrait.
6  */
7
8 namespace Drupal\Console\Command\Shared;
9
10 use Symfony\Component\Console\Input\InputInterface;
11 use Drupal\Console\Core\Style\DrupalStyle;
12
13 /**
14  * Class DatabaseTrait
15  *
16  * @package Drupal\Console\Command\Shared
17  */
18 trait DatabaseTrait
19 {
20     /**
21      * @param DrupalStyle $io
22      *
23      * @return mixed
24      */
25     public function dbHostQuestion(DrupalStyle $io)
26     {
27         return $io->ask(
28             $this->trans('commands.migrate.execute.questions.db-host'),
29             '127.0.0.1'
30         );
31     }
32
33     /**
34      * @param DrupalStyle $io
35      *
36      * @return mixed
37      */
38     public function dbNameQuestion(DrupalStyle $io)
39     {
40         return $io->ask(
41             $this->trans('commands.migrate.execute.questions.db-name')
42         );
43     }
44
45     /**
46      * @param DrupalStyle $io
47      *
48      * @return mixed
49      */
50     public function dbUserQuestion(DrupalStyle $io)
51     {
52         return $io->ask(
53             $this->trans('commands.migrate.execute.questions.db-user')
54         );
55     }
56
57     /**
58      * @param DrupalStyle $io
59      *
60      * @return mixed
61      */
62     public function dbPassQuestion(DrupalStyle $io)
63     {
64         return $io->askHiddenEmpty(
65             $this->trans('commands.migrate.execute.questions.db-pass')
66         );
67     }
68
69     /**
70      * @param DrupalStyle $io
71      *
72      * @return mixed
73      */
74     public function dbPrefixQuestion(DrupalStyle $io)
75     {
76         return $io->askEmpty(
77             $this->trans('commands.migrate.execute.questions.db-prefix')
78         );
79     }
80
81     /**
82      * @param DrupalStyle $io
83      *
84      * @return mixed
85      */
86     public function dbPortQuestion(DrupalStyle $io)
87     {
88         return $io->ask(
89             $this->trans('commands.migrate.execute.questions.db-port'),
90             '3306'
91         );
92     }
93 }