/** * @return \RainLoop\Application */ public function Config() { if (null === $this->oConfig) { $this->oConfig = new \RainLoop\Config\Application(); $bSave = defined('APP_INSTALLED_START'); if (!$this->oConfig->Load()) { $bSave = true; } else { if (!$bSave) { $bSave = APP_VERSION !== $this->oConfig->Get('version', 'current'); } } if ($bSave) { $this->oConfig->Save(); } } return $this->oConfig; }
/** * @return \RainLoop\Application */ public function Config() { if (null === $this->oConfig) { $this->oConfig = new \RainLoop\Config\Application(); // $bSave = defined('APP_INSTALLED_START'); // if (!$this->oConfig->Load()) // { // $bSave = true; // } // else if (!$bSave) // { // $bSave = APP_VERSION !== $this->oConfig->Get('version', 'current'); // } $bSave = defined('APP_INSTALLED_START'); $bLoaded = $this->oConfig->Load(); if (!$bLoaded && !$bSave) { usleep(10000); // TODO $bLoaded = $this->oConfig->Load(); } if (!$bLoaded && !$this->oConfig->IsFileExists()) { $bSave = true; } if ($bLoaded && !$bSave) { $bSave = APP_VERSION !== $this->oConfig->Get('version', 'current'); } if ($bSave) { $this->oConfig->Save(); } } return $this->oConfig; }