Jelix\Installer\Installer::__construct PHP Метод

__construct() публичный Метод

it reads configurations files of all entry points, and prepare object for each module, needed to install/upgrade modules.
public __construct ( ReporterInterface $reporter, string $lang = '' )
$reporter ReporterInterface object which is responsible to process messages (display, storage or other..)
$lang string the language code for messages
    function __construct(ReporterInterface $reporter, $lang = '')
    {
        $this->reporter = $reporter;
        $this->messages = new Checker\Messages($lang);
        $localConfig = App::configPath('localconfig.ini.php');
        if (!file_exists($localConfig)) {
            $localConfigDist = App::configPath('localconfig.ini.php.dist');
            if (file_exists($localConfigDist)) {
                copy($localConfigDist, $localConfig);
            } else {
                file_put_contents($localConfig, ';<' . '?php die(\'\');?' . '>');
            }
        }
        $this->mainConfig = new \Jelix\IniFile\MultiIniModifier(\Jelix\Core\Config::getDefaultConfigFile(), App::mainConfigFile());
        $this->localConfig = new \Jelix\IniFile\MultiIniModifier($this->mainConfig, $localConfig);
        $this->installerIni = $this->getInstallerIni();
        $urlfile = App::appConfigPath($this->localConfig->getValue('significantFile', 'urlengine'));
        $this->xmlMapFile = new \Jelix\Routing\UrlMapping\XmlMapModifier($urlfile, true);
        $appInfos = new \Jelix\Core\Infos\AppInfos();
        $this->readEntryPointsData($appInfos);
        $this->installerIni->save();
        // be sure temp path is ready
        $chmod = $this->mainConfig->getValue('chmodDir');
        \jFile::createDir(App::tempPath(), intval($chmod, 8));
    }