| @@ 737-756 (lines=20) @@ | ||
| 734 | * |
|
| 735 | * @return string[] |
|
| 736 | */ |
|
| 737 | protected function getMigrationFiles() |
|
| 738 | { |
|
| 739 | $config = $this->getConfig(); |
|
| 740 | $paths = $config->getMigrationPaths(); |
|
| 741 | $files = []; |
|
| 742 | ||
| 743 | foreach ($paths as $path) { |
|
| 744 | $files = array_merge( |
|
| 745 | $files, |
|
| 746 | Util::glob($path . DIRECTORY_SEPARATOR . '*.php') |
|
| 747 | ); |
|
| 748 | } |
|
| 749 | // glob() can return the same file multiple times |
|
| 750 | // This will cause the migration to fail with a |
|
| 751 | // false assumption of duplicate migrations |
|
| 752 | // http://php.net/manual/en/function.glob.php#110340 |
|
| 753 | $files = array_unique($files); |
|
| 754 | ||
| 755 | return $files; |
|
| 756 | } |
|
| 757 | ||
| 758 | /** |
|
| 759 | * Sets the database seeders. |
|
| @@ 883-902 (lines=20) @@ | ||
| 880 | * |
|
| 881 | * @return string[] |
|
| 882 | */ |
|
| 883 | protected function getSeedFiles() |
|
| 884 | { |
|
| 885 | $config = $this->getConfig(); |
|
| 886 | $paths = $config->getSeedPaths(); |
|
| 887 | $files = []; |
|
| 888 | ||
| 889 | foreach ($paths as $path) { |
|
| 890 | $files = array_merge( |
|
| 891 | $files, |
|
| 892 | Util::glob($path . DIRECTORY_SEPARATOR . '*.php') |
|
| 893 | ); |
|
| 894 | } |
|
| 895 | // glob() can return the same file multiple times |
|
| 896 | // This will cause the migration to fail with a |
|
| 897 | // false assumption of duplicate migrations |
|
| 898 | // http://php.net/manual/en/function.glob.php#110340 |
|
| 899 | $files = array_unique($files); |
|
| 900 | ||
| 901 | return $files; |
|
| 902 | } |
|
| 903 | ||
| 904 | /** |
|
| 905 | * Sets the config. |
|