Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
HistoryStorage Class Reference

Public Member Functions

 __construct ($file='', $autosave=true)
 
 __destruct ()
 
 load ()
 
 save ()
 
 getData ()
 
 setData ($data)
 
 setMaxSize ($n)
 
 getMaxSize ()
 

Detailed Description

Stores an array in memory, and reads/writes that array as lines in a file.

Author
Daniel Simmons dan@d.nosp@m.ans..nosp@m.im 2010 Daniel Simmons http://www.opensource.org/licenses/mit-license.php

Definition at line 1789 of file matrixsqlclient.php.

Constructor & Destructor Documentation

__construct (   $file = '',
  $autosave = true 
)

Constructor

Parameters
string$filepath and filename where history should be saved
boolean$autosavewhether to save history items to file on destruct

Definition at line 1818 of file matrixsqlclient.php.

__destruct ( )

Destructor - writes data to file if autosave flag is true

Definition at line 1827 of file matrixsqlclient.php.

Member Function Documentation

getData ( )

Returns an array of the data stored in memory.

Returns
array get all data stored in memory

Definition at line 1871 of file matrixsqlclient.php.

getMaxSize ( )

Shows the the maximum number of lines that will be saved to file as per the current configuration.

Returns
integer the current max number of lines that will be saved

Definition at line 1911 of file matrixsqlclient.php.

load ( )

Reads lines from the file into memory.

Returns
mixed the data from the file, or false if the file couldn't be read

Definition at line 1839 of file matrixsqlclient.php.

save ( )

Saves contents of memory into file.

Returns
mixed number of bytes that were written to the file, or false on failure.

Definition at line 1857 of file matrixsqlclient.php.

setData (   $data)

Updates the array stored in the memory.

Parameters
array$datathe data to store
Returns
mixed void or false if supplied data is not an array

Definition at line 1883 of file matrixsqlclient.php.

setMaxSize (   $n)

Sets the maximum number of lines that will be saved to file.

Parameters
integer$nnumber of lines
Returns
void

Definition at line 1900 of file matrixsqlclient.php.


The documentation for this class was generated from the following file: