Esempio n. 1
0
 protected function expandPath($path)
 {
     if (strpos($path, 'www:') === 0) {
         $path = str_replace('www:', App::wwwPath(), $path);
     } elseif (strpos($path, 'jelixwww:') === 0) {
         $p = $this->config->getValue('jelixWWWPath', 'urlengine');
         if (substr($p, -1) != '/') {
             $p .= '/';
         }
         $path = str_replace('jelixwww:', App::wwwPath($p), $path);
     } elseif (strpos($path, 'config:') === 0) {
         $path = str_replace('config:', App::configPath(), $path);
     } elseif (strpos($path, 'epconfig:') === 0) {
         $p = dirname(App::configPath($this->entryPoint->configFile));
         $path = str_replace('epconfig:', $p . '/', $path);
     }
     return $path;
 }
Esempio n. 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);
     $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));
 }