示例#1
0
 public function clear($name)
 {
     $name = (string) $name;
     if ($this->propertyExists($name, 'set')) {
         return parent::clear($name);
     }
     return $this->_clearByKey($name, $GLOBALS[$this->_getSourceName()]);
 }
示例#2
0
 /**
  * Clear setting value
  *
  * Clear the setting value and return former value. If a setting with the
  * name specified is not found, null is returned.
  *
  * @uses AeSettings_Driver::$_namePattern
  *
  * @throws AeSettingsDriverException #400 if setting name is invalid
  *
  * @param string $name setting name
  *
  * @return AeType|mixed former setting value
  */
 public function clear($name)
 {
     $name = (string) $name;
     if ($this->propertyExists($name, 'set')) {
         return parent::clear($name);
     }
     if (!preg_match($this->_namePattern, $name)) {
         throw new AeSettingsDriverException('Setting name is invalid', 400);
     }
     if (strpos($name, '.')) {
         list($section, $name) = explode('.', $name, 2);
     } else {
         $section = $this->section;
     }
     return parent::clear($section . '.' . $name);
 }
示例#3
0
 /**
  * Get session variable
  *
  * Returns the session variable, identified by the <var>$name</var>
  * parameter, or the <var>$default</var>, if variable is not set or is null
  *
  * @uses AeSession::_check() to check for session state
  *
  * @throws AeSessionException #403 if session validation failed
  * @throws AeSessionException #408 if session has expired
  * @throws AeSessionException #412 if session has been destroyed
  *
  * @param string $name
  * @param mixed  $default
  *
  * @return object|AeScalar|AeArray
  */
 public function get($name, $default = null)
 {
     $name = (string) $name;
     if ($this->propertyExists($name)) {
         // *** Never wrap object properties
         return parent::get($name, $default);
     }
     $this->_check();
     if (!preg_match($this->_keyPattern, (string) $name)) {
         throw new AeSessionException('Key name is invalid', 400);
     }
     $return = $this->_getByKey((string) $name, $_SESSION);
     return AeType::wrapReturn($return, $default);
 }