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

Class: MySQLSessionStorage

Source Location: /storage/MySQLSessionStorage.class.php

Class Overview

ParameterHolder
   |
   --Storage
      |
      --SessionStorage
         |
         --MySQLSessionStorage

Provides support for session storage using a MySQL brand database.


Author(s):

  • Sean Kerr (skerr@mojavi.org)

Version:

  • $Id: MySQLSessionStorage.class.php 775 2005-03-24 01:57:22Z seank $

Copyright:

Methods


Inherited Variables

Inherited Methods

Class: SessionStorage

SessionStorage::initialize()
Initialize this Storage.
SessionStorage::read()
Read data from this storage.
SessionStorage::remove()
Remove data from this storage.
SessionStorage::shutdown()
Execute the shutdown procedure.
SessionStorage::write()
Write data to this storage.

Class: Storage

Storage::getContext()
Retrieve the current application context.
Storage::initialize()
Initialize this Storage.
Storage::newInstance()
Retrieve a new Storage implementation instance.
Storage::read()
Read data from this storage.
Storage::remove()
Remove data from this storage.
Storage::shutdown()
Execute the shutdown procedure.
Storage::write()
Write data to this storage.

Class: ParameterHolder

ParameterHolder::clearParameters()
Clear all parameters associated with this request.
ParameterHolder::getParameter()
Retrieve a parameter.
ParameterHolder::getParameterNames()
Retrieve an array of parameter names.
ParameterHolder::getParameters()
Retrieve an array of parameters.
ParameterHolder::hasParameter()
Indicates whether or not a parameter exists.
ParameterHolder::removeParameter()
Remove a parameter.
ParameterHolder::setParameter()
Set a parameter.
ParameterHolder::setParameterByRef()
Set a parameter by reference.
ParameterHolder::setParameters()
Set an array of parameters.
ParameterHolder::setParametersByRef()
Set an array of parameters by reference.

Class Details

[line 38]
Provides support for session storage using a MySQL brand database.

Required parameters:

  • db_table - [none] - The database table in which session data will be stored.
Optional parameters:

  • db_id_col - [sess_id] - The database column in which the session id will be stored.
  • db_data_col - [sess_data] - The database column in which the session data will be stored.
  • db_time_col - [sess_time] - The database column in which the session timestamp will be stored.
  • session_name - [Mojavi] - The name of the session.




Tags:

version:  $Id: MySQLSessionStorage.class.php 775 2005-03-24 01:57:22Z seank $
since:  3.0.0
copyright:  (c) Sean Kerr, http://www.mojavi.org
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]


Class Methods


method initialize [line 67]

bool initialize( Context $context, [array $parameters = null])

Initialize this Storage.



Tags:

return:  true, if initialization completes successfully, otherwise false.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  InitializationException If an error occurs while initializing this Storage.


Overrides SessionStorage::initialize() (Initialize this Storage.)

Parameters:

Context   $context   A Context instance.
array   $parameters   An associative array of initialization parameters.

[ Top ]

method sessionClose [line 110]

bool sessionClose( )

Close a session.



Tags:

return:  true, if the session was closed, otherwise false.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


[ Top ]

method sessionDestroy [line 133]

bool sessionDestroy( string $id)

Destroy a session.



Tags:

return:  true, if the session was destroyed, otherwise an exception is thrown.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  DatabaseException If the session cannot be destroyed.


Parameters:

string   $id   A session ID.

[ Top ]

method sessionGC [line 177]

bool sessionGC( int $lifetime)

Cleanup old sessions.



Tags:

return:  true, if old sessions have been cleaned, otherwise an exception is thrown.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  DatabaseException If any old sessions cannot be cleaned.


Parameters:

int   $lifetime   The lifetime of a session.

[ Top ]

method sessionOpen [line 222]

bool sessionOpen( string $path, string $name)

Open a session.



Tags:

return:  true, if the session was opened, otherwise an exception is thrown.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  DatabaseException If a connection with the database does not exist or cannot be created.


Parameters:

string   $path  
string   $name  

[ Top ]

method sessionRead [line 253]

bool sessionRead( string $id)

Read a session.



Tags:

return:  true, if the session was read, otherwise an exception is thrown.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  DatabaseException If the session cannot be read.


Parameters:

string   $id   A session ID.

[ Top ]

method sessionWrite [line 321]

bool sessionWrite( string $id, string &$data)

Write session data.



Tags:

return:  true, if the session was written, otherwise an exception is thrown.
access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)
throws:  DatabaseException If the session data cannot be written.


Parameters:

string   $id   A session ID.
string   &$data   A serialized chunk of session data.

[ Top ]

method shutdown [line 365]

void shutdown( )

Execute the shutdown procedure.



Tags:

access:  public
since:  3.0.0
author:  Sean Kerr (skerr@mojavi.org)


Overrides SessionStorage::shutdown() (Execute the shutdown procedure.)

[ Top ]


Documentation generated on Tue, 21 Feb 2006 01:45:22 +0900 by phpDocumentor 1.3.0RC5