You are here

Request.php in Anti Spam by CleanTalk 8.4

Same filename and directory in other branches
  1. 9.1.x src/lib/Cleantalk/Common/Variables/Request.php

File

src/lib/Cleantalk/Common/Variables/Request.php
View source
<?php

namespace Cleantalk\Common\Variables;


/**
 * Class Request
 * Safety handler for $_REQUEST
 *
 * @usage \CleantalkSP\Variables\Request::get( $name );
 *
 * @package \CleantalkSP\Variables
 */
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;
  }

}

Classes

Namesort descending Description
Request Class Request Safety handler for $_REQUEST