You are here

class Request in Anti Spam by CleanTalk 8.4

Same name and namespace in other branches
  1. 9.1.x src/lib/Cleantalk/Common/Variables/Request.php \Cleantalk\Common\Variables\Request

Class Request Safety handler for $_REQUEST

@usage \CleantalkSP\Variables\Request::get( $name );

@package \CleantalkSP\Variables

Hierarchy

Expanded class hierarchy of Request

File

src/lib/Cleantalk/Common/Variables/Request.php, line 13

Namespace

Cleantalk\Common\Variables
View source
class Request extends SuperGlobalVariables {
  static $instance;

  /**
   * Gets given $_REQUEST variable and save it to memory
   * @param $name
   *
   * @return mixed|string
   */
  protected function get_variable($name) {

    // Return from memory. From $this->variables
    if (isset(static::$instance->variables[$name])) {
      return static::$instance->variables[$name];
    }
    $value = isset($_REQUEST[$name]) ? $_REQUEST[$name] : '';

    // Remember for thurther calls
    static::getInstance()
      ->remember_variable($name, $value);
    return $value;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Request::$instance static property Overrides Singleton::$instance
Request::get_variable protected function * Gets given $_REQUEST variable and save it to memory * Overrides SuperGlobalVariables::get_variable
Singleton::getInstance public static function Constructor
Singleton::init protected function Alternative constructor
Singleton::__clone public function
Singleton::__construct public function
Singleton::__wakeup public function
SuperGlobalVariables::$variables public property *
SuperGlobalVariables::equal static function * Checks if variable equal to $param * *
SuperGlobalVariables::get public static function * Gets variable from ${_SOMETHING} * *
SuperGlobalVariables::has_string static function * Checks if variable contains given string * *
SuperGlobalVariables::remember_variable protected function * Save variable to $this->variables[] * *