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