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

Class: HTTP_FloodControl_Container_File

Source Location: /HTTP_FloodControl-0.1.1/FloodControl/Container/File.php

Class Overview

HTTP_FloodControl_Container
   |
   --HTTP_FloodControl_Container_File

File container class for storing data of HTTP_FloodControl package


Author(s):

Methods


Inherited Variables

Inherited Methods

Class: HTTP_FloodControl_Container

HTTP_FloodControl_Container::__construct()
Constructor
HTTP_FloodControl_Container::gc()
Garbage collector
HTTP_FloodControl_Container::read()
Read data associated with a given unique ID
HTTP_FloodControl_Container::set()
Init container
HTTP_FloodControl_Container::write()
Write data associated with a given unique ID to container
HTTP_FloodControl_Container::_parseOptions()
Parse options passed to the container class
HTTP_FloodControl_Container::_setDefaults()
Set some default options

Class Details

[line 49]
File container class for storing data of HTTP_FloodControl package


[ Top ]


Method Detail

__construct (Constructor)   [line 62]

void __construct( mixed $options)

Constructor
  • Access: public

Overrides HTTP_FloodControl_Container::__construct() (Constructor)

Parameters:

mixed   $options   —  An array of additional options for the container object or a path to directory of counter logs.

[ Top ]

gc   [line 176]

void gc( int $lifetime)

Garbage collector

This function is responsible for garbage collection. It is responsible for deleting old counter logs.

  • Throws: HTTP_FloodControl_Exception if an error occured during garbage collection.
  • Access: public

Overrides HTTP_FloodControl_Container::gc() (Garbage collector)

Parameters:

int   $lifetime   —  Maximum lifetime of counter logs.

[ Top ]

read   [line 121]

mixed read( $uniqueId, string $uniqurId)

Read data associated with a given unique ID
  • Return: An array of data associated with a given unique ID or false in case of incorrect data format.
  • Throws: HTTP_FloodControl_Exception if an error occured while reading from log file.
  • Access: public

Overrides HTTP_FloodControl_Container::read() (Read data associated with a given unique ID)

Parameters:

string   $uniqurId   —  IP address or other unique ID.
   $uniqueId   — 

[ Top ]

set   [line 96]

void set( )

Init File container
  • Throws: HTTP_FloodControl_Exception in case of incorrect directory path of counter logs.
  • Access: public

Overrides HTTP_FloodControl_Container::set() (Init container)
[ Top ]

write   [line 150]

void write( string $uniqueId, array $data)

Write data associated with a given unique ID to container
  • Throws: HTTP_FloodControl_Exception if an error occured during writing process.
  • Access: public

Overrides HTTP_FloodControl_Container::write() (Write data associated with a given unique ID to container)

Parameters:

string   $uniqueId   —  IP address or other unique ID.
array   $data   —  The data associated with a given unique ID.

[ Top ]

_setDefaults   [line 81]

void _setDefaults( )

Set some default options
  • Access: protected

Overrides HTTP_FloodControl_Container::_setDefaults() (Set some default options)
[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:57:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.