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::readLine()
Convert a raw line from the file to it's internal representation.
ListInFile::sync()
Write the full list to the file.
ListInFile::writeLine()
Return a formated record.

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 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 138]

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 update [line 119]

Boolean update( String $ip, Integer $now)

Update the buffer and returns whatever the maximum of request for the period has been reached.



Tags:

access:  public


Parameters:

String   $ip   ip
Integer   $now   now timestamp

[ Top ]

method writeLine [line 153]

String writeLine( String $key, String $value)

Return a formated record.



Tags:

access:  public


Overrides ListInFile::writeLine() (Return a formated record.)

Parameters:

String   $key   key
String   $value   value

[ Top ]


Documentation generated on Thu, 04 Sep 2008 11:40:00 +0200 by phpDocumentor 1.3.0RC3