@@ -170,9 +170,27 @@ public function load_migration_state()
170170 */
171171 public function set_migrations ($ class_names )
172172 {
173+ foreach ($ class_names as $ key => $ class )
174+ {
175+ if (!self ::is_migration ($ class ))
176+ {
177+ unset($ class_names [$ key ]);
178+ }
179+ }
180+
173181 $ this ->migrations = $ class_names ;
174182 }
175183
184+ /**
185+ * Get the list of available migration class names
186+ *
187+ * @return array Array of all migrations available to be run
188+ */
189+ public function get_migrations ()
190+ {
191+ return $ this ->migrations ;
192+ }
193+
176194 /**
177195 * Runs a single update step from the next migration to be applied.
178196 *
@@ -226,7 +244,7 @@ protected function update_do()
226244 */
227245 protected function try_apply ($ name )
228246 {
229- if (!self :: is_migration ($ name ))
247+ if (!class_exists ($ name ))
230248 {
231249 $ this ->output_handler ->write (array ('MIGRATION_NOT_VALID ' , $ name ), migrator_output_handler_interface::VERBOSITY_DEBUG );
232250 return false ;
@@ -401,7 +419,7 @@ protected function revert_do($migration)
401419 */
402420 protected function try_revert ($ name )
403421 {
404- if (!self :: is_migration ($ name ))
422+ if (!class_exists ($ name ))
405423 {
406424 return false ;
407425 }
@@ -719,7 +737,7 @@ public function unfulfillable($name)
719737 return false ;
720738 }
721739
722- if (!self :: is_migration ($ name ))
740+ if (!class_exists ($ name ))
723741 {
724742 return $ name ;
725743 }
0 commit comments