1 | <?php |
||
7 | class Migrator extends M |
||
8 | { |
||
9 | /** |
||
10 | * Fully qualified path to the application's migration directory |
||
11 | * |
||
12 | * @var string |
||
13 | */ |
||
14 | private $path; |
||
15 | |||
16 | /** |
||
17 | * Get all of the migration files in a given path. |
||
18 | * |
||
19 | * @param string $path |
||
20 | * @param bool $recursive |
||
21 | * |
||
22 | * @return array |
||
23 | */ |
||
24 | public function getMigrationFiles($path, $recursive = true) |
||
53 | |||
54 | /** |
||
55 | * Require in all the migration files in a given path. |
||
56 | * |
||
57 | * @param array $files |
||
58 | * |
||
59 | * @return void |
||
60 | */ |
||
61 | public function requireFiles(array $files) |
||
68 | |||
69 | /** |
||
70 | * Run "up" a migration instance. |
||
71 | * |
||
72 | * @param string $file |
||
73 | * @param int $batch |
||
74 | * @param bool $pretend |
||
75 | * |
||
76 | * @return void |
||
77 | */ |
||
78 | protected function runUp($file, $batch, $pretend) |
||
98 | |||
99 | /** |
||
100 | * Recursive glob. |
||
101 | * |
||
102 | * @param string $pattern |
||
103 | * @param int $flags |
||
104 | * @param bool $ignore |
||
105 | * |
||
106 | * @return array |
||
107 | */ |
||
108 | public function rglob($pattern, $flags = 0, $ignore = false) |
||
122 | |||
123 | /** |
||
124 | * Get the migration file path with our injected date folder. |
||
125 | * |
||
126 | * @param string $file |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | public function getFilePathWithFolders($file) |
||
136 | |||
137 | /** |
||
138 | * Remove folders from file path. |
||
139 | * |
||
140 | * @param string $file |
||
141 | * |
||
142 | * @return string |
||
143 | */ |
||
144 | public function getFilePathWithoutFolders($file) |
||
148 | |||
149 | /** |
||
150 | * Add date folders to migrations path. |
||
151 | * |
||
152 | * @param string $file |
||
153 | * |
||
154 | * @return string |
||
155 | */ |
||
156 | public function getDateFolderStructure($file) |
||
162 | |||
163 | /** |
||
164 | * Set the path |
||
165 | * |
||
166 | * @param array|string $path |
||
167 | */ |
||
168 | private function setPath($path) |
||
172 | } |
||
173 |