class SuperGlobalVariables in Anti Spam by CleanTalk 9.1.x
Same name and namespace in other branches
- 8.4 src/lib/Cleantalk/Common/Variables/SuperGlobalVariables.php \Cleantalk\Common\Variables\SuperGlobalVariables
Class ServerVariables Safety handler for ${_SOMETHING}
@depends \Cleantalk\Common\Templates\Singleton
@usage \CleantalkSP\Variables\{SOMETHING}::get( $name );
@package \CleantalkSP\Variables
Hierarchy
- class \Cleantalk\Common\Variables\SuperGlobalVariables uses Singleton
Expanded class hierarchy of SuperGlobalVariables
File
- src/
lib/ Cleantalk/ Common/ Variables/ SuperGlobalVariables.php, line 17
Namespace
Cleantalk\Common\VariablesView source
class SuperGlobalVariables {
use Singleton;
/**
* @var array Contains saved variables
*/
public $variables = [];
/**
* Gets variable from ${_SOMETHING}
*
* @param string $name Variable name
*
* @return string
*/
public static function get($name) {
return static::getInstance()
->get_variable($name);
}
/**
* BLUEPRINT
* Gets given ${_SOMETHING} variable and seva it to memory
* @param $name
*
* @return mixed|string
*/
protected function get_variable($name) {
return true;
}
/**
* Save variable to $this->variables[]
*
* @param string $name
* @param string $value
*/
protected function remember_variable($name, $value) {
static::$instance->variables[$name] = $value;
}
/**
* Checks if variable contains given string
*
* @param string $var Haystack to search in
* @param string $string Needle to search
*
* @return bool|int
*/
static function has_string($var, $string) {
return stripos(self::get($var), $string) !== false;
}
/**
* Checks if variable equal to $param
*
* @param string $var Variable to compare
* @param string $param Param to compare
*
* @return bool|int
*/
static function equal($var, $param) {
return self::get($var) == $param;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Singleton:: |
public static | property | 5 | |
Singleton:: |
public static | function | Constructor | |
Singleton:: |
protected | function | Alternative constructor | |
Singleton:: |
public | function | ||
Singleton:: |
public | function | ||
Singleton:: |
public | function | ||
SuperGlobalVariables:: |
public | property | * | |
SuperGlobalVariables:: |
static | function | * Checks if variable equal to $param * * | |
SuperGlobalVariables:: |
public static | function | * Gets variable from ${_SOMETHING} * * | |
SuperGlobalVariables:: |
protected | function | * BLUEPRINT * Gets given ${_SOMETHING} variable and seva it to memory * | 5 |
SuperGlobalVariables:: |
static | function | * Checks if variable contains given string * * | |
SuperGlobalVariables:: |
protected | function | * Save variable to $this->variables[] * * |