Jelix\Installer\Installer::runPostInstall PHP Method

runPostInstall() protected method

protected runPostInstall ( $installedModules, $ep, $flags )
    protected function runPostInstall($installedModules, $ep, $flags)
    {
        $result = true;
        // post install
        foreach ($installedModules as $item) {
            try {
                list($installer, $component, $action) = $item;
                if ($action == Resolver::ACTION_INSTALL) {
                    if ($installer && $flags & self::FLAG_INSTALL_MODULE) {
                        $installer->postInstall();
                        $component->installFinished($ep);
                    }
                } else {
                    if ($action == Resolver::ACTION_UPGRADE) {
                        if ($flags & self::FLAG_UPGRADE_MODULE) {
                            foreach ($installer as $upgrader) {
                                $upgrader->postInstall();
                                $component->upgradeFinished($ep, $upgrader);
                            }
                        }
                    } elseif ($action == Resolver::ACTION_REMOVE) {
                        if ($installer && $flags & self::FLAG_REMOVE_MODULE) {
                            $installer->postUninstall();
                            $component->uninstallFinished($ep);
                        }
                    }
                }
                // we always save the configuration, so it invalidates the cache
                $ep->getConfigIni()->save();
                $this->xmlMapFile->save();
                // we re-load configuration file for each module because
                // previous module installer could have modify it.
                $compiler = new \Jelix\Core\Config\Compiler($ep->getConfigFile(), $ep->scriptName, $ep->isCliScript);
                $ep->setConfigObj($compiler->read(true));
                App::setConfig($ep->getConfigObj());
            } catch (Exception $e) {
                $result = false;
                $this->error($e->getLocaleKey(), $e->getLocaleParameters());
            } catch (\Exception $e) {
                $result = false;
                $this->error('install.module.error', array($component->getName(), $e->getMessage()));
            }
        }
        return $result;
    }