repo->ofName($cmd->name); } catch (PluginNotFoundException $th) { $pw = null; } $output = new BufferedOutput(); if ($pw) { $code = $this->helper->reinstall($cmd->name->value, $output); } else { $code = $this->helper->require($cmd->name->value, $output); } if ($code !== 0) { throw new RuntimeException( "Failed to install plugin with following code: " . $output->fetch() ); } // Set status to inactive $context = new Context($this->pluginsDir . '/' . $cmd->name->value); $context->setStatus(Status::INACTIVE); // Clear cache $this->cache->clearCache(); } }