Пример #1
0
 /**
  * return the value of an option from the master ini file only.
  * If the option doesn't exist, it returns null.
  *
  * @param string $name       the name of the option to retrieve
  * @param string $section    the section where the option is. 0 is the global section
  * @param string $key        for option which is an item of array, the key in the array
  *
  * @return mixed the value
  */
 public function getValueOnMaster($name, $section = 0, $key = null)
 {
     return $this->master->getValue($name, $section, $key);
 }
Пример #2
0
 /**
  * initialize the installation
  *
  * it reads configurations files of all entry points, and prepare object for
  * each module, needed to install/upgrade modules.
  * @param ReporterInterface $reporter  object which is responsible to process messages (display, storage or other..)
  * @param string $lang  the language code for messages
  */
 function __construct(ReporterInterface $reporter, $lang = '')
 {
     $this->reporter = $reporter;
     $this->messages = new Checker\Messages($lang);
     $this->mainConfig = new \Jelix\IniFile\IniModifier(App::mainConfigFile());
     $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->localConfig = new \Jelix\IniFile\MultiIniModifier($this->mainConfig, $localConfig);
     $this->installerIni = $this->getInstallerIni();
     $appInfos = new \Jelix\Core\Infos\AppInfos();
     $this->readEntryPointsData($appInfos);
     $this->installerIni->save();
     // be sure temp path is ready
     \jFile::createDir(App::tempPath(), intval($this->mainConfig->getValue('chmodDirValue'), 8));
 }