| @@ -45,19 +45,28 @@ | ||
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * @throws MissingColumnsException |
| 48 | 48 | */ |
| 49 | + private function runInstall(): void | |
| 50 | + { | |
| 51 | + $this->databaseHandler->install(); | |
| 52 | + } | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * @throws MissingColumnsException | |
| 56 | + */ | |
| 49 | 57 | public function install(bool $networkWide = false): void |
| 50 | 58 | { |
| 51 | - if ($networkWide === false) { | |
| 52 | - $this->databaseHandler->install(); | |
| 53 | - return; | |
| 54 | - } | |
| 59 | + if ($networkWide === true) { | |
| 60 | + $blogIds = $this->getBlogIds(); | |
| 55 | 61 | |
| 56 | - foreach ($this->getBlogIds() as $blogId) { | |
| 57 | - $this->wordpress->switchToBlog($blogId); | |
| 58 | - $this->databaseHandler->install(); | |
| 59 | - $this->wordpress->restoreCurrentBlog(); | |
| 62 | + foreach ($blogIds as $blogId) { | |
| 63 | + $this->wordpress->switchToBlog($blogId); | |
| 64 | + $this->runInstall(); | |
| 65 | + $this->wordpress->restoreCurrentBlog(); | |
| 66 | + } | |
| 67 | + } else { | |
| 68 | + $this->runInstall(); | |
| 60 | 69 | } |
| 61 | 70 | } |
| 62 | 71 | |
| 63 | 72 | public function update(): bool |