A class to check request restrictions expressed as a JSON object.
More...
A class to check request restrictions expressed as a JSON object.
Definition at line 27 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 141 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 114 of file MWRestrictions.php.
References toArray().
Referenced by __toString().
The documentation for this class was generated from the following file: