symfony API

sfMySQLSessionStorage Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.4 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.4 version. Switch to:

Provides support for session storage using a MySQL brand database.

Inheritence

sfMySQLiSessionStorage  <  sfMySQLSessionStorage  <  sfDatabaseSessionStorage < sfSessionStorage < sfStorage

Method Summary

  • string db_error()
    Returns the text of the error message from previous database operation
  • string db_escape($string)
    Escapes a string before using it in a query statement
  • array db_fetch_row($result)
    Extracts a row from a query result set
  • int db_num_rows($result)
    Counts the rows in a query result
  • mixed db_query($query)
    Executes an SQL Query
  • bool sessionDestroy($id)
    Destroys a session.
  • bool sessionGC($lifetime)
    Cleans up old sessions.
  • string sessionRead($id)
    Reads a session.
  • bool sessionWrite($id, $data)
    Writes session data.

Methods inherited from sfDatabaseSessionStorage

initialize , regenerate , sessionClose , sessionDestroy , sessionGC , sessionOpen , sessionRead , sessionWrite , shutdown

Methods inherited from sfSessionStorage

initialize , read , regenerate , remove , shutdown , write

Methods inherited from sfStorage

getOptions , initialize , read , regenerate , remove , shutdown , write , __construct

Method Details

  • (string) db_error () Browse code

    Returns the text of the error message from previous database operation

    returns The error text from the last database function

  • (string) db_escape ($string) Browse code

    $string The string to escape

    Escapes a string before using it in a query statement

    returns The escaped string

  • (array) db_fetch_row ($result) Browse code

    $result Result of a query

    Extracts a row from a query result set

    returns Extracted row as an indexed array

  • (int) db_num_rows ($result) Browse code

    $result Result of a query

    Counts the rows in a query result

    returns Number of rows

  • (mixed) db_query ($query) Browse code

    $query The query to execute

    Executes an SQL Query

    returns The result of the query

  • (bool) sessionDestroy ($id) Browse code

    $id A session ID

    Destroys a session.

    returns true, if the session was destroyed, otherwise an exception is thrown

    throws sfDatabaseException If the session cannot be destroyed.

  • (bool) sessionGC ($lifetime) Browse code

    $lifetime The lifetime of a session

    Cleans up old sessions.

    returns true, if old sessions have been cleaned, otherwise an exception is thrown

    throws sfDatabaseException If any old sessions cannot be cleaned

  • (string) sessionRead ($id) Browse code

    $id A session ID

    Reads a session.

    returns The session data if the session was read or created, otherwise an exception is thrown

    throws sfDatabaseException If the session cannot be read

  • (bool) sessionWrite ($id, $data) Browse code

    $id A session ID
    $data A serialized chunk of session data

    Writes session data.

    returns true, if the session was written, otherwise an exception is thrown

    throws sfDatabaseException If the session data cannot be written