| @@ 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 | } |
|
| @@ 33-54 (lines=22) @@ | ||
| 30 | { |
|
| 31 | $mainServiceProviderNameStartWith = 'Main'; |
|
| 32 | ||
| 33 | foreach (PortButler::getContainersNames() as $containerName) { |
|
| 34 | ||
| 35 | $containerProvidersDirectory = base_path('app/Containers/' . $containerName . '/Providers'); |
|
| 36 | ||
| 37 | if (File::isDirectory($containerProvidersDirectory)) { |
|
| 38 | ||
| 39 | $files = \File::allFiles($containerProvidersDirectory); |
|
| 40 | ||
| 41 | foreach ($files as $file) { |
|
| 42 | ||
| 43 | if (\File::isFile($file)) { |
|
| 44 | ||
| 45 | // Check if this is the Main Service Provider |
|
| 46 | if (PortButler::stringStartsWith($file->getFilename(), $mainServiceProviderNameStartWith)) { |
|
| 47 | $serviceProviderClass = PortButler::getClassFullNameFromFile($file->getPathname()); |
|
| 48 | ||
| 49 | $this->loadProvider($serviceProviderClass); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | } |
|
| 53 | } |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||
| 57 | private function loadProvidersFromPort() |
|
| @@ 70-81 (lines=12) @@ | ||
| 67 | public function getAllContainersConsoleCommandsForAutoLoading() |
|
| 68 | { |
|
| 69 | $classes = []; |
|
| 70 | foreach (PortButler::getContainersNames() as $containerName) { |
|
| 71 | $containerCommandsDirectory = base_path('app/Containers/' . $containerName . '/UI/CLI/Commands/'); |
|
| 72 | if (File::isDirectory($containerCommandsDirectory)) { |
|
| 73 | $files = \File::allFiles($containerCommandsDirectory); |
|
| 74 | foreach ($files as $consoleFile) { |
|
| 75 | if (\File::isFile($consoleFile)) { |
|
| 76 | $pathName = $consoleFile->getPathname(); |
|
| 77 | $classes[] = PortButler::getClassFullNameFromFile($pathName); |
|
| 78 | } |
|
| 79 | } |
|
| 80 | } |
|
| 81 | }; |
|
| 82 | ||
| 83 | return $classes; |
|
| 84 | } |
|