[ Index ]
 

Code source de SPIP Agora 1.4

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Pear/Log/ -> sqlite.php (sommaire)

(pas de description)

Poids: 238 lignes (8 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Log_sqlite:: (5 méthodes):
  Log_sqlite()
  open()
  close()
  log()
  _createTable()


Classe: Log_sqlite  - X-Ref

The Log_sqlite class is a concrete implementation of the Log::
abstract class which sends messages to an Sqlite database.
Each entry occupies a separate row in the database.

This implementation uses PHP native Sqlite functions.

CREATE TABLE log_table (
id          INTEGER PRIMARY KEY NOT NULL,
logtime     NOT NULL,
ident       CHAR(16) NOT NULL,
priority    INT NOT NULL,
message
);

Log_sqlite($name, $ident = '', &$conf, $level = PEAR_LOG_DEBUG)   X-Ref
Constructs a new sql logging object.

param: string $name         The target SQL table.
param: string $ident        The identification field.
param: mixed  $conf         Can be an array of configuration options used
param: int    $level        Log messages up to and including this level.

open()   X-Ref
Opens a connection to the database, if it has not already
been opened. This is implicitly called by log(), if necessary.

return: boolean   True on success, false on failure.

close()   X-Ref
Closes the connection to the database if it is still open and we were
the ones that opened it.  It is the caller's responsible to close an
existing connection that was passed to us via $conf['db'].

return: boolean   True on success, false on failure.

log($message, $priority = null)   X-Ref
Inserts $message to the currently open database.  Calls open(),
if necessary.  Also passes the message along to any Log_observer
instances that are observing this Log.

param: mixed  $message  String or object containing the message to log.
param: string $priority The priority of the message.  Valid
return: boolean  True on success or false on failure.

_createTable()   X-Ref
Checks whether the log table exists and creates it if necessary.

return: boolean  True on success or false on failure.



Généré le : Sat Feb 24 14:40:03 2007 par Balluche grâce à PHPXref 0.7