| @@ 123-134 (lines=12) @@ | ||
| 120 | public function getAllContainersConsoleCommandsForAutoLoading() |
|
| 121 | { |
|
| 122 | $classes = []; |
|
| 123 | foreach (PortButler::getContainersNames() as $containerName) { |
|
| 124 | $containerCommandsDirectory = base_path('app/Containers/' . $containerName . '/UI/CLI/Commands/'); |
|
| 125 | if (File::isDirectory($containerCommandsDirectory)) { |
|
| 126 | $files = \File::allFiles($containerCommandsDirectory); |
|
| 127 | foreach ($files as $consoleFile) { |
|
| 128 | if (\File::isFile($consoleFile)) { |
|
| 129 | $pathName = $consoleFile->getPathname(); |
|
| 130 | $classes[] = PortButler::getClassFullNameFromFile($pathName); |
|
| 131 | } |
|
| 132 | } |
|
| 133 | } |
|
| 134 | }; |
|
| 135 | ||
| 136 | return $classes; |
|
| 137 | } |
|
| @@ 31-53 (lines=23) @@ | ||
| 28 | public function run() |
|
| 29 | { |
|
| 30 | ||
| 31 | foreach (PortButler::getContainersNames() as $containerName) { |
|
| 32 | ||
| 33 | $containersDirectory = base_path('app/Containers/' . $containerName . $this->seedersPath); |
|
| 34 | ||
| 35 | if (\File::isDirectory($containersDirectory)) { |
|
| 36 | ||
| 37 | $files = \File::allFiles($containersDirectory); |
|
| 38 | ||
| 39 | foreach ($files as $seederClass) { |
|
| 40 | ||
| 41 | if (\File::isFile($seederClass)) { |
|
| 42 | ||
| 43 | $pathName = $seederClass->getPathname(); |
|
| 44 | ||
| 45 | $class = PortButler::getClassFullNameFromFile($pathName); |
|
| 46 | ||
| 47 | $this->call($class); |
|
| 48 | } |
|
| 49 | ||
| 50 | } |
|
| 51 | ||
| 52 | } |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||
| 56 | } |
|