<?php
/*
- * Copyright (C) 2003-2004 Polytechnique.org
+ * Copyright (C) 2003-2011 Polytechnique.org
* http://opensource.polytechnique.org/
*
* This program is free software; you can redistribute it and/or modify
*/
abstract public function log($action, $data = null);
- /** Build a logger.
+ /** Check validity of the logger.
+ *
+ * @param $uid the uid of the current session.
+ * @return TRUE if the logger can still be used.
*/
- public static function get($uid, $suid = 0)
- {
- if (defined('PL_LOGGER_CLASS')) {
- $class = PL_LOGGER_CLASS;
- return new $class($uid, $suid);
- } else {
- return new DummyLogger($uid, $suid);
- }
- }
-}
+ abstract public function isValid($uid);
-class DummyLogger extends PlLogger
-{
- public function __construct($uid, $suid = 0)
- {
- }
-
- public function log($action, $data = null)
- {
+ /** Return a dummy logger.
+ */
+ public static function dummy($uid, $suid = 0) {
+ return new DummyLogger($uid, $suid);
}
}
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
?>