$cleanOnCheck
$cleanOnCheck : boolean
Should storage be cleaned when it is checked
Stores limit data in database table
Example MySQL table
CREATE TABLE IF NOT EXISTS limit
(
type
varchar(32) NOT NULL,
ip
varchar(45) NOT NULL,
timestamp
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
KEY type
(type
,ip
),
KEY timestamp
(timestamp
)
) ENGINE=InnoDB DEFAULT CHARSET=ascii;
$cleanInterval : \Spork\DateTime\DateInterval
Remove data after this amount of time.
getCleanInterval() : \Spork\DateTime\DateInterval
Get clean interval
setDbAdapter(\Zend\Db\Adapter\Adapter|string $dbAdapter) : \Spork\Mvc\Listener\Limit\Storage\Db
Set database adapter or service name
\Zend\Db\Adapter\Adapter|string | $dbAdapter |
setTable(string $table) : \Spork\Mvc\Listener\Limit\Storage\Db
Set table name
string | $table |
setTypeColumn(string $typeColumn) : \Spork\Mvc\Listener\Limit\Storage\Db
Set type column name
string | $typeColumn |
setTimestampColumn(string $timestampColumn) : \Spork\Mvc\Listener\Limit\Storage\Db
Set timestamp column name
string | $timestampColumn |
setIpColumn(string $ipColumn) : \Spork\Mvc\Listener\Limit\Storage\Db
Get IP column name
string | $ipColumn |
check(string $ip, \Spork\Mvc\Listener\Limit\Limit $limit) : boolean
Check if the number or records in the database exceeds the set limit
string | $ip | |
\Spork\Mvc\Listener\Limit\Limit | $limit |