Plugins
[ class tree: Plugins ] [ index: Plugins ] [ all elements ]

Class: Buffer

Source Location: /plugins/throttling/client/Throttling.php

Class Overview

ListInFile
   |
   --Buffer

Buffer class, record ip access count.


Variables

Methods


Inherited Variables

Inherited Methods

Class: ListInFile

ListInFile::__construct()
ListInFile constructor.
ListInFile::populateList()
Reads file and builds matching list.
ListInFile::readLine()
Convert a raw line from the file to it's internal representation.

Class Details

[line 71]
Buffer class, record ip access count.



[ Top ]


Class Variables

$maxRequest =

[line 81]



Tags:

var:  Maximum number of request per ip for this period.
access:  protected

Type:   Integer


[ Top ]

$period =

[line 76]



Tags:

var:  Buffer period in second.
access:  protected

Type:   Integer


[ Top ]



Class Methods


constructor __construct [line 90]

Buffer __construct( String $file, Integer $period, Integer $maxRequest)

Buffer constructor.



Tags:

access:  public


Overrides ListInFile::__construct() (ListInFile constructor.)

Parameters:

String   $file   file
Integer   $period   period Buffer period in second.
Integer   $maxRequest   maxRequest number of request before an overflow

[ Top ]

method checkOverflow [line 136]

Boolean checkOverflow( String $ip)

Test if IP is already listed and if yes, if it has reached the max request limit.



Tags:

access:  public


Parameters:

String   $ip   ip

[ Top ]

method clear [line 102]

void clear( Integer $now)

Remove record if the period has passed.



Tags:

access:  public


Parameters:

Integer   $now   timestamp

[ Top ]

method readLine [line 146]

void readLine( String $line)

Convert a raw line from the file to it's internal representation.



Tags:

access:  public


Overrides ListInFile::readLine() (Convert a raw line from the file to it's internal representation.)

Parameters:

String   $line   raw line

[ Top ]

method sync [line 185]

void sync( integer $ip, boolean $update_required)

Update and write the full list to the file.



Tags:

access:  public


Parameters:

integer   $ip   IP
boolean   $update_required  

[ Top ]

method update [line 117]

void update( String $ip, Integer $now)

Update the buffer.



Tags:

access:  public


Parameters:

String   $ip   ip
Integer   $now   now timestamp

[ Top ]

method writeLine [line 161]

String writeLine( String $key, String $value)

Return a formated record.



Tags:

access:  protected


Parameters:

String   $key   key
String   $value   value

[ Top ]

method writeToFile [line 168]

void writeToFile( )

Writes list content to matching buffer file.



Tags:

access:  protected


[ Top ]


Documentation generated on Mon, 20 May 2013 13:31:35 +0200 by phpDocumentor 1.3.0RC3