1 /* Copyright (C) 2000-2004 Thomas Bopp, Thorsten Hampel, Ludger Merkens
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 * $Id: modules.pike,v 1.1 2008/03/31 13:39:57 exodusd Exp $
19 inherit "/kernel/db_mapping";
21 #include <attributes.h>
22 //! This module is used for storing all other modules inside the database.
23 //! So it enables a lookup "module" and get the related sTeam module object.
24 class modules : public db_mapping{
33 mixed get_value(string|int key)
35 return ::get_value(key);
38 int set_value(string|int key, mixed value)
40 if (CALLER!=_Database && CALLER!= _Server)
41 THROW("illegal attempt to register a module from "+
42 master()->stupid_describe(CALLER)+ "different from "+
43 master()->stupid_describe(_Database), E_ACCESS);
44 return ::set_value(key, value);
48 * This is a hack, since the modules module is no real object, it is
49 * created each time the server is started. So database connection is done
50 * on creation and not on (post)_initialization
53 * @see post_init_db_mapping
67 string get_identifier() { return "modules"; }
73 string get_table_name() {