26 private static $VALUES_VARNAME =
'Obfuscator.values';
28 private $_session = null;
35 $this->_session = $session;
44 if (strlen($str) == 0) {
47 $this->ensureStorage();
50 $obfuscated = md5($str);
51 $values = $this->_session->get(self::$VALUES_VARNAME);
52 $values[$obfuscated] = $str;
53 $this->_session->set(self::$VALUES_VARNAME, $values);
64 $this->ensureStorage();
66 $values = $this->_session->get(self::$VALUES_VARNAME);
67 if (isset($values[$str])) {
78 private function ensureStorage() {
79 if (!$this->_session->exist(self::$VALUES_VARNAME)) {
81 $this->_session->set(self::$VALUES_VARNAME, $values);
obfuscate($str)
Get an obfuscated string.
Session is the interface for session implementations and defines access to session variables...
__construct(Session $session)
Constructor.
Obfuscator allows to obfuscate strings.
unveil($str)
Get an unveiled string.