1 | <?php |
||
14 | class MigrateCommand extends Command |
||
15 | { |
||
16 | /** |
||
17 | * @var string Table name where migrations info is kept |
||
18 | */ |
||
19 | const MIGRATIONS_TABLE = 'migrations'; |
||
20 | |||
21 | /** |
||
22 | * Configuration of command |
||
23 | */ |
||
24 | protected function configure() |
||
31 | |||
32 | /** |
||
33 | * Execute method of command |
||
34 | * |
||
35 | * @param InputInterface $input |
||
36 | * @param OutputInterface $output |
||
37 | * |
||
38 | * @return void |
||
39 | */ |
||
40 | protected function execute(InputInterface $input, OutputInterface $output) |
||
56 | |||
57 | /** |
||
58 | * Run list of migrations in files |
||
59 | * |
||
60 | * @param Finder $files list of files to run |
||
61 | * @param OutputInterface $output |
||
62 | * |
||
63 | * @return void |
||
64 | */ |
||
65 | private function runActionFiles(Finder $files, OutputInterface $output) |
||
89 | |||
90 | /** |
||
91 | * Return class name by file basename |
||
92 | * @param string $baseName |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | private function getMigrationClass($baseName) |
||
109 | |||
110 | /** |
||
111 | * @param string $tableName |
||
112 | * @param OutputInterface $output |
||
113 | */ |
||
114 | private function safeCreateTable($tableName, OutputInterface $output) |
||
135 | |||
136 | /** |
||
137 | * @param $name |
||
138 | * @param $table |
||
139 | * @return bool |
||
140 | */ |
||
141 | private function isRowExist($name, $table) |
||
146 | |||
147 | /** |
||
148 | * @param $name |
||
149 | * @param $table |
||
150 | */ |
||
151 | private function insertRow($name, $table) |
||
157 | } |
||
158 |