/** * @see InstallAbstractModel::display() */ public function display() { // The installer SHOULD take less than 32M, but may take up to 35/36M sometimes. So 42M is a good value :) $low_memory = Tools::getMemoryLimit() < Tools::getOctets('42M'); // We fill the process step used for Ajax queries $this->process_steps[] = array('key' => 'generateSettingsFile', 'lang' => $this->l('Create settings.inc file')); $this->process_steps[] = array('key' => 'installDatabase', 'lang' => $this->l('Create database tables')); $this->process_steps[] = array('key' => 'installDefaultData', 'lang' => $this->l('Create default shop and languages')); // If low memory, create subtasks for populateDatabase step (entity per entity) $populate_step = array('key' => 'populateDatabase', 'lang' => $this->l('Populate database tables')); if ($low_memory) { $populate_step['subtasks'] = array(); $xml_loader = new InstallXmlLoader(); foreach ($xml_loader->getSortedEntities() as $entity) { $populate_step['subtasks'][] = array('entity' => $entity); } } $this->process_steps[] = $populate_step; $this->process_steps[] = array('key' => 'configureShop', 'lang' => $this->l('Configure shop information')); $install_modules = array('key' => 'installModules', 'lang' => $this->l('Install modules')); if ($low_memory) { foreach ($this->model_install->getModulesList() as $module) { $install_modules['subtasks'][] = array('module' => $module); } } $this->process_steps[] = $install_modules; $install_modules = array('key' => 'installModulesAddons', 'lang' => $this->l('Install Addons modules')); $params = array('iso_lang' => $this->language->getLanguageIso(), 'iso_country' => $this->session->shop_country, 'email' => $this->session->admin_email, 'shop_url' => Tools::getHttpHost(), 'version' => _PS_INSTALL_VERSION_); if ($low_memory) { foreach ($this->model_install->getAddonsModulesList($params) as $module) { $install_modules['subtasks'][] = array('module' => (string) $module['name'], 'id_module' => (string) $module['id_module']); } } $this->process_steps[] = $install_modules; // Fixtures are installed only if option is selected if ($this->session->install_type == 'full') { // If low memory, create subtasks for installFixtures step (entity per entity) $fixtures_step = array('key' => 'installFixtures', 'lang' => $this->l('Install demonstration data')); if ($low_memory) { $fixtures_step['subtasks'] = array(); $xml_loader = new InstallXmlLoader(); $xml_loader->setFixturesPath(); foreach ($xml_loader->getSortedEntities() as $entity) { $fixtures_step['subtasks'][] = array('entity' => $entity); } } $this->process_steps[] = $fixtures_step; } $this->process_steps[] = array('key' => 'installTheme', 'lang' => $this->l('Install theme')); $this->displayTemplate('process'); }
/** * @see InstallAbstractModel::display() */ public function display() { // The installer SHOULD take less than 32M, but may take up to 35/36M sometimes. So 42M is a good value :) $low_memory = Tools::getMemoryLimit() < Tools::getOctets('42M'); // We fill the process step used for Ajax queries $this->process_steps[] = array('key' => 'generateSettingsFile', 'lang' => $this->l('Create settings.inc file')); $this->process_steps[] = array('key' => 'installDatabase', 'lang' => $this->l('Create database tables')); $this->process_steps[] = array('key' => 'installDefaultData', 'lang' => $this->l('Create default shop and languages')); // If low memory, create subtasks for populateDatabase step (entity per entity) $populate_step = array('key' => 'populateDatabase', 'lang' => $this->l('Populate database tables')); if ($low_memory) { $populate_step['subtasks'] = array(); $xml_loader = new InstallXmlLoader(); foreach ($xml_loader->getSortedEntities() as $entity) { $populate_step['subtasks'][] = array('entity' => $entity); } } $this->process_steps[] = $populate_step; $this->process_steps[] = array('key' => 'configureShop', 'lang' => $this->l('Configure shop information')); $install_modules = array('key' => 'installModules', 'lang' => $this->l('Install modules')); if ($low_memory) { foreach ($this->model_install->getModulesList() as $module) { $install_modules['subtasks'][] = array('module' => $module); } } $this->process_steps[] = $install_modules; // Fixtures are installed only if option is selected if ($this->session->install_type == 'full') { // If low memory, create subtasks for installFixtures step (entity per entity) $fixtures_step = array('key' => 'installFixtures', 'lang' => $this->l('Install demonstration data')); if ($low_memory) { $fixtures_step['subtasks'] = array(); $xml_loader = new InstallXmlLoader(); $xml_loader->setFixturesPath(); foreach ($xml_loader->getSortedEntities() as $entity) { $fixtures_step['subtasks'][] = array('entity' => $entity); } } $this->process_steps[] = $fixtures_step; } $this->process_steps[] = array('key' => 'installTheme', 'lang' => $this->l('Install theme')); // Mail is send only if option is selected if ($this->session->send_informations) { $this->process_steps[] = array('key' => 'sendEmail', 'lang' => $this->l('Send information e-mail')); } $this->displayTemplate('process'); }
/** * PROCESS : installModulesAddons * Install modules from addons */ public function processInstallAddonsModules() { return $this->model_install->installModulesAddons(); }