A class to check request restrictions expressed as a JSON object.
More...
|
| __toString () |
|
| check (WebRequest $request) |
| Test against the passed WebRequest.
|
|
| checkIP ( $ip) |
| Test if an IP address is allowed by the restrictions.
|
|
| toArray () |
| Return the restrictions as an array.
|
|
| toJson ( $pretty=false) |
| Return the restrictions as a JSON string.
|
|
A class to check request restrictions expressed as a JSON object.
Definition at line 29 of file MWRestrictions.php.
◆ __construct()
MWRestrictions::__construct |
( |
array | $restrictions = null | ) |
|
|
protected |
◆ __toString()
MWRestrictions::__toString |
( |
| ) |
|
◆ check()
◆ checkIP()
MWRestrictions::checkIP |
( |
| $ip | ) |
|
Test if an IP address is allowed by the restrictions.
- Parameters
-
- Returns
- bool
Definition at line 143 of file MWRestrictions.php.
Referenced by check().
◆ newDefault()
static MWRestrictions::newDefault |
( |
| ) |
|
|
static |
◆ newFromArray()
static MWRestrictions::newFromArray |
( |
array | $restrictions | ) |
|
|
static |
◆ newFromJson()
static MWRestrictions::newFromJson |
( |
| $json | ) |
|
|
static |
◆ toArray()
MWRestrictions::toArray |
( |
| ) |
|
◆ toJson()
MWRestrictions::toJson |
( |
| $pretty = false | ) |
|
Return the restrictions as a JSON string.
- Parameters
-
bool | string | $pretty | Pretty-print the JSON output, see FormatJson::encode |
- Returns
- string
Definition at line 116 of file MWRestrictions.php.
References toArray().
Referenced by __toString().
The documentation for this class was generated from the following file: