| @@ 845-864 (lines=20) @@ | ||
| 842 | * |
|
| 843 | * @return string[] |
|
| 844 | */ |
|
| 845 | protected function getMigrationFiles() |
|
| 846 | { |
|
| 847 | $config = $this->getConfig(); |
|
| 848 | $paths = $config->getMigrationPaths($this->getEnvironmentName(), $this->getDbRef()); |
|
| 849 | $files = []; |
|
| 850 | ||
| 851 | foreach ($paths as $path) { |
|
| 852 | $files = array_merge( |
|
| 853 | $files, |
|
| 854 | Util::glob($path . DIRECTORY_SEPARATOR . '*.php') |
|
| 855 | ); |
|
| 856 | } |
|
| 857 | // glob() can return the same file multiple times |
|
| 858 | // This will cause the migration to fail with a |
|
| 859 | // false assumption of duplicate migrations |
|
| 860 | // http://php.net/manual/en/function.glob.php#110340 |
|
| 861 | $files = array_unique($files); |
|
| 862 | ||
| 863 | return $files; |
|
| 864 | } |
|
| 865 | ||
| 866 | /** |
|
| 867 | * Sets the database seeders. |
|
| @@ 942-962 (lines=21) @@ | ||
| 939 | * |
|
| 940 | * @return string[] |
|
| 941 | */ |
|
| 942 | protected function getSeedFiles() |
|
| 943 | { |
|
| 944 | $config = $this->getConfig(); |
|
| 945 | $paths = $config->getSeedPaths($this->getEnvironmentName(), $this->getDbRef()); |
|
| 946 | ||
| 947 | $files = []; |
|
| 948 | ||
| 949 | foreach ($paths as $path) { |
|
| 950 | $files = array_merge( |
|
| 951 | $files, |
|
| 952 | Util::glob($path . DIRECTORY_SEPARATOR . '*.php') |
|
| 953 | ); |
|
| 954 | } |
|
| 955 | // glob() can return the same file multiple times |
|
| 956 | // This will cause the migration to fail with a |
|
| 957 | // false assumption of duplicate migrations |
|
| 958 | // http://php.net/manual/en/function.glob.php#110340 |
|
| 959 | $files = array_unique($files); |
|
| 960 | ||
| 961 | return $files; |
|
| 962 | } |
|
| 963 | ||
| 964 | /** |
|
| 965 | * Sets the config. |
|