setTodayArchiveTimeToLive() public static method

public static setTodayArchiveTimeToLive ( $timeToLiveSeconds )
Esempio n. 1
0
File: API.php Progetto: piwik/piwik
 /**
  * @internal
  */
 public function setArchiveSettings($enableBrowserTriggerArchiving, $todayArchiveTimeToLive)
 {
     Piwik::checkUserHasSuperUserAccess();
     if (!Controller::isGeneralSettingsAdminEnabled()) {
         throw new Exception('General settings admin is ont enabled');
     }
     Rules::setBrowserTriggerArchiving((bool) $enableBrowserTriggerArchiving);
     Rules::setTodayArchiveTimeToLive($todayArchiveTimeToLive);
     return true;
 }
Esempio n. 2
0
 private function saveGeneralSettings()
 {
     if (!self::isGeneralSettingsAdminEnabled()) {
         // General settings + Beta channel + SMTP settings is disabled
         return;
     }
     // General Setting
     $enableBrowserTriggerArchiving = Common::getRequestVar('enableBrowserTriggerArchiving');
     $todayArchiveTimeToLive = Common::getRequestVar('todayArchiveTimeToLive');
     Rules::setBrowserTriggerArchiving((bool) $enableBrowserTriggerArchiving);
     Rules::setTodayArchiveTimeToLive($todayArchiveTimeToLive);
     // update beta channel setting
     $debug = Config::getInstance()->Debug;
     $debug['allow_upgrades_to_beta'] = Common::getRequestVar('enableBetaReleaseCheck', '0', 'int');
     Config::getInstance()->Debug = $debug;
     // Update email settings
     $mail = array();
     $mail['transport'] = Common::getRequestVar('mailUseSmtp') == '1' ? 'smtp' : '';
     $mail['port'] = Common::getRequestVar('mailPort', '');
     $mail['host'] = Common::unsanitizeInputValue(Common::getRequestVar('mailHost', ''));
     $mail['type'] = Common::getRequestVar('mailType', '');
     $mail['username'] = Common::unsanitizeInputValue(Common::getRequestVar('mailUsername', ''));
     $mail['password'] = Common::unsanitizeInputValue(Common::getRequestVar('mailPassword', ''));
     $mail['encryption'] = Common::getRequestVar('mailEncryption', '');
     Config::getInstance()->mail = $mail;
     // update trusted host settings
     $trustedHosts = Common::getRequestVar('trustedHosts', false, 'json');
     if ($trustedHosts !== false) {
         Url::saveTrustedHostnameInConfig($trustedHosts);
     }
     Config::getInstance()->forceSave();
     $pluginUpdateCommunication = new UpdateCommunication();
     if (Common::getRequestVar('enablePluginUpdateCommunication', '0', 'int')) {
         $pluginUpdateCommunication->enable();
     } else {
         $pluginUpdateCommunication->disable();
     }
 }
Esempio n. 3
0
 private function saveGeneralSettings()
 {
     if (!$this->isGeneralSettingsAdminEnabled()) {
         // General settings + Beta channel + SMTP settings is disabled
         return;
     }
     // General Setting
     $enableBrowserTriggerArchiving = Common::getRequestVar('enableBrowserTriggerArchiving');
     $todayArchiveTimeToLive = Common::getRequestVar('todayArchiveTimeToLive');
     Rules::setBrowserTriggerArchiving((bool) $enableBrowserTriggerArchiving);
     Rules::setTodayArchiveTimeToLive($todayArchiveTimeToLive);
     // update beta channel setting
     $debug = Config::getInstance()->Debug;
     $debug['allow_upgrades_to_beta'] = Common::getRequestVar('enableBetaReleaseCheck', '0', 'int');
     Config::getInstance()->Debug = $debug;
     // Update email settings
     $mail = array();
     $mail['transport'] = Common::getRequestVar('mailUseSmtp') == '1' ? 'smtp' : '';
     $mail['port'] = Common::getRequestVar('mailPort', '');
     $mail['host'] = Common::unsanitizeInputValue(Common::getRequestVar('mailHost', ''));
     $mail['type'] = Common::getRequestVar('mailType', '');
     $mail['username'] = Common::unsanitizeInputValue(Common::getRequestVar('mailUsername', ''));
     $mail['password'] = Common::unsanitizeInputValue(Common::getRequestVar('mailPassword', ''));
     $mail['encryption'] = Common::getRequestVar('mailEncryption', '');
     Config::getInstance()->mail = $mail;
 }