PrivateBin\Persistence\ServerSalt::setPath PHP Method

setPath() public static method

set the path
public static setPath ( string $path ) : void
$path string
return void
    public static function setPath($path)
    {
        self::$_salt = '';
        parent::setPath($path);
    }

Usage Example

Example #1
0
 /**
  * initialize privatebin
  *
  * @access private
  * @return void
  */
 private function _init()
 {
     foreach (array('cfg', 'lib') as $dir) {
         if (!is_file(PATH . $dir . DIRECTORY_SEPARATOR . '.htaccess')) {
             file_put_contents(PATH . $dir . DIRECTORY_SEPARATOR . '.htaccess', 'Allow from none' . PHP_EOL . 'Deny from all' . PHP_EOL, LOCK_EX);
         }
     }
     $this->_conf = new Configuration();
     $this->_model = new Model($this->_conf);
     $this->_request = new Request();
     $this->_urlBase = array_key_exists('REQUEST_URI', $_SERVER) ? htmlspecialchars($_SERVER['REQUEST_URI']) : '/';
     ServerSalt::setPath($this->_conf->getKey('dir', 'traffic'));
     // set default language
     $lang = $this->_conf->getKey('languagedefault');
     I18n::setLanguageFallback($lang);
     // force default language, if language selection is disabled and a default is set
     if (!$this->_conf->getKey('languageselection') && strlen($lang) == 2) {
         $_COOKIE['lang'] = $lang;
         setcookie('lang', $lang);
     }
 }