/** * Installs the extra modules of the provided profile * @param string $profile The name of the profile * @return null */ public function installProfile($profile, $languages) { if (!$this->hasRequirementsMet($profile)) { throw new ZiboException('Could not install profile ' . $profile . ': The requirements are not met.'); } $client = ClientModule::getClient(); if (!$client) { throw new ZiboException('Could not install profile ' . $profile . ': The repository client is not properly configured.'); } // install the necessairy modules $profile = $this->getProfile($profile); $modules = $profile->getModules(); foreach ($modules as $module) { $client->installModule($module->getNamespace(), $module->getName()); } // install the extra languages foreach ($languages as $languageCode) { if ($languageCode == 'en') { continue; } $client->installModule('zibo', 'l10n.' . $languageCode); } $profile->install(); }
<?php use zibo\repository\ClientModule; $module = new ClientModule(); $module->initialize();
/** * Initializes the installer and the repository before every action * @return null */ public function preAction() { $this->installer = new Installer(); $this->client = ClientModule::getClient($this->installer); if (!$this->client) { throw new ZiboException('The client module needs to be configured, missing setting ' . ClientModule::CONFIG_REPOSITORY); } $translator = $this->getTranslator(); $this->breadcrumbs = new Breadcrumbs(); $this->breadcrumbs->setLabel($translator->translate(self::TRANSLATION_NAMESPACE)); $this->breadcrumbs->addBreadcrumb($this->request->getBasePath(), $translator->translate(self::TRANSLATION_NAMESPACE_HOME)); }