Download the PHP package webiik/attempts without Composer
On this page you can find all versions of the php package webiik/attempts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webiik/attempts
More information about webiik/attempts
Files in webiik/attempts
Package attempts
Short Description The Attempts provides common interface for user actions monitoring.
License MIT
Homepage https://www.webiik.com
Informations about the package attempts
Attempts
The Attempts provides common interface for user actions monitoring.
Installation
Example
The following example expects you have already written your custom storage.
Configuration
setStorage
setStorage() sets storage factory. Storage writes, reads and deletes user attempts. Every storage must implement StorageInterface to get more info. Keep on mind you have to write your own storage. For example, you can write storage that uses MySQL database to write, read and delete user attempts.
User Identifier
getIp
getIp() returns user IP address.
Attempts
write
write() writes user attempt to storage.
Parameters
- label label representing user action e.g. login
- ip user IP address (simple user identifier)
- hash advanced user identifier e.g. hash from user IP, OS, browser language and installed fonts
read
read() reads user attempts from storage by label, hash and ip starting from startTimestamp.
readByIp
readByIp() reads user attempts from storage by label and ip starting from startTimestamp.
readByHash
readByHash() reads user attempts from storage by label and hash starting from startTimestamp.
delete
delete() deletes user attempts from storage by the specific label, older than the timestamp, with default probability 1/100.
deleteAll
deleteAll() deletes user attempts from storage older than the timestamp, with default probability 1/100.