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