Ejemplo n.º 1
0
 public function validate()
 {
     $inTrackerRequest = SettingsServer::isTrackerApiRequest();
     $inConsole = Common::isPhpCliMode();
     $this->checkConfigFileExists($this->settingsProvider->getPathGlobal());
     $this->checkConfigFileExists($this->settingsProvider->getPathLocal(), $startInstaller = !$inTrackerRequest && !$inConsole);
 }
Ejemplo n.º 2
0
 public function validate()
 {
     $this->checkConfigFileExists($this->settingsProvider->getPathGlobal());
     if (SettingsPiwik::isPiwikInstalled()) {
         $this->checkConfigFileExists($this->settingsProvider->getPathLocal(), $startInstaller = false);
         return;
     }
     $startInstaller = true;
     if (SettingsServer::isTrackerApiRequest()) {
         // if Piwik is not installed yet, the piwik.php should do nothing and not return an error
         throw new NotYetInstalledException("As Piwik is not installed yet, the Tracking API cannot proceed and will exit without error.");
     }
     if (Common::isPhpCliMode()) {
         // in CLI, do not start/redirect to installer, simply output the exception at the top
         $startInstaller = false;
     }
     // Start the installation when config file not found
     $this->checkConfigFileExists($this->settingsProvider->getPathLocal(), $startInstaller);
 }
Ejemplo n.º 3
0
 /**
  * Returns the list of plugins that are bundled with Piwik.
  *
  * @return string[]
  */
 public function getPluginsBundledWithPiwik()
 {
     $pathGlobal = $this->settings->getPathGlobal();
     $section = $this->settings->getIniFileChain()->getFrom($pathGlobal, 'Plugins');
     return $section['Plugins'];
 }