From 9bdcb088ebddb422cd8e9a27e688e9718cf50013 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Mon, 2 Jun 2008 22:30:19 +0000 Subject: Implemented a better algorithm for keeping the plugins and the references to them (and their attributes) in the DB in sync: * The DB now keeps a hash-value for the list of known plugins and their attributes and checks this value against the current one on every connect. If the values do not match, the DB is brought up-to-date automatically (i.e. the attributes are synchronized with the systems, clients and groups). git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1837 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/OpenSLX/MetaDB/DBI.pm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'config-db/OpenSLX/MetaDB') diff --git a/config-db/OpenSLX/MetaDB/DBI.pm b/config-db/OpenSLX/MetaDB/DBI.pm index 7acb861f..c4606f0c 100644 --- a/config-db/OpenSLX/MetaDB/DBI.pm +++ b/config-db/OpenSLX/MetaDB/DBI.pm @@ -1273,6 +1273,29 @@ sub schemaSetDBVersion return 1; } +sub schemaFetchPluginInfoHashVal +{ + my $self = shift; + + my $row + = $self->{dbh}->selectrow_hashref('SELECT plugin_info_hash FROM meta'); + + return $row->{plugin_info_hash}; +} + +sub schemaSetPluginInfoHashVal +{ + my $self = shift; + my $pluginInfoHashVal = shift; + + $self->{dbh}->do("UPDATE meta SET plugin_info_hash = '$pluginInfoHashVal'") + or croak _tr( + 'Unable to set plugin-info-hash-value to %s!', $pluginInfoHashVal + ); + + return 1; +} + sub schemaConvertTypeDescrToNative { # a default implementation, many DBs need to override... my $self = shift; -- cgit v1.2.3-55-g7522