<?php
/*
- * Copyright (C) 2003-2004 Polytechnique.org
+ * Copyright (C) 2003-2010 Polytechnique.org
* http://opensource.polytechnique.org/
*
* This program is free software; you can redistribute it and/or modify
*/
abstract public function isValid($uid);
- /** Build a logger.
- */
- 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);
- }
- }
-
/** Return a dummy logger.
*/
public static function dummy($uid, $suid = 0) {
}
}
-class DummyLogger extends PlLogger
-{
- private $uid;
-
- public function __construct($uid, $suid = 0)
- {
- $this->uid = $uid;
- }
-
- public function log($action, $data = null)
- {
- }
-
- public function isValid($uid)
- {
- return $uid == $this->uid;
- }
-}
-
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>