Piwik\SettingsPiwik::isAutoUpdateEnabled PHP 메소드

isAutoUpdateEnabled() 공개 정적인 메소드

Detect whether user has enabled auto updates. Please note this config is a bit misleading. It is currently actually used for 2 things: To disable making any connections back to Piwik, and to actually disable the auto update of core and plugins.
public static isAutoUpdateEnabled ( ) : boolean
리턴 boolean
    public static function isAutoUpdateEnabled()
    {
        return (bool) Config::getInstance()->General['enable_auto_update'];
    }

Usage Example

예제 #1
0
파일: UpdateCheck.php 프로젝트: piwik/piwik
 /**
  * Check for a newer version
  *
  * @param bool $force Force check
  * @param int $interval Interval used for update checks
  */
 public static function check($force = false, $interval = null)
 {
     if (!SettingsPiwik::isAutoUpdateEnabled()) {
         return;
     }
     if ($interval === null) {
         $interval = self::CHECK_INTERVAL;
     }
     $lastTimeChecked = Option::get(self::LAST_TIME_CHECKED);
     if ($force || $lastTimeChecked === false || time() - $interval > $lastTimeChecked) {
         // set the time checked first, so that parallel Piwik requests don't all trigger the http requests
         Option::set(self::LAST_TIME_CHECKED, time(), $autoLoad = 1);
         $latestVersion = self::getLatestAvailableVersionNumber();
         $latestVersion = trim((string) $latestVersion);
         if (!preg_match('~^[0-9][0-9a-zA-Z_.-]*$~D', $latestVersion)) {
             $latestVersion = '';
         }
         Option::set(self::LATEST_VERSION, $latestVersion);
     }
 }
All Usage Examples Of Piwik\SettingsPiwik::isAutoUpdateEnabled