Piwik\SettingsPiwik::getSalt PHP Метод

getSalt() публичный статический Метод

Get salt from [General] section
public static getSalt ( ) : string
Результат string
    public static function getSalt()
    {
        static $salt = null;
        if (is_null($salt)) {
            $salt = @Config::getInstance()->General['salt'];
        }
        return $salt;
    }

Usage Example

 /**
  * Cache buster based on
  *  - Piwik version
  *  - Loaded plugins
  *  - Super user salt
  *  - Latest
  *
  * @param string[] $pluginNames
  * @return string
  */
 public function piwikVersionBasedCacheBuster($pluginNames = false)
 {
     $currentGitHash = @file_get_contents(PIWIK_INCLUDE_PATH . '/.git/refs/heads/master');
     $pluginList = md5(implode(",", !$pluginNames ? Manager::getInstance()->getLoadedPluginsName() : $pluginNames));
     $cacheBuster = md5(SettingsPiwik::getSalt() . $pluginList . PHP_VERSION . Version::VERSION . trim($currentGitHash));
     return $cacheBuster;
 }
All Usage Examples Of Piwik\SettingsPiwik::getSalt