[prev] [thread] [next] [lurker] [Date index for 2002/09/09]
Update of /cvsroot/siesta/siesta/lib/Siesta/Storage In directory usw-pr-cvs1:/tmp/cvs-serv32005 Modified Files: DBI.pm Log Message: layout fixes Index: DBI.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Storage/DBI.pm,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- DBI.pm 9 Sep 2002 11:16:45 -0000 1.16 +++ DBI.pm 9 Sep 2002 13:02:21 -0000 1.17 @@ -279,11 +279,11 @@ my $return = $self->get_config_explicitly($namespace, $user_id, $list_id, $key); my $sql; - # are we updating + # are we updating if (defined $return) { - $sql = sprintf( "UPDATE config set value=%s where - namespace=%s AND user_id=%s AND - list_id=%s AND key=%s", + $sql = sprintf( "UPDATE config set value = %s where + namespace = %s AND user_id = %s AND + list_id = %s AND key = %s", $self->_dbh->quote($value), $self->_dbh->quote($namespace), $self->_dbh->quote($user_id), @@ -322,8 +322,6 @@ sub get_config { my ($self, $namespace, $user_id, $list_id, $key) = @_; - - $user_id ||= ''; $list_id ||= ''; @@ -331,43 +329,42 @@ unless ($user_id eq '' || $list_id eq '') { my $return = $self->get_config_explicitly($namespace, $user_id, $list_id, $key); return $return - if defined $return; - } + if defined $return; + } unless ($user_id eq '') { my $return = $self->get_config_explicitly($namespace, $user_id, '', $key); return $return if defined $return; - } + } unless ($list_id eq '') { my $return = $self->get_config_explicitly($namespace, '', $list_id, $key); return $return if defined $return; - } + } return $self->get_config_explicitly($namespace, '', '', $key); } # explicitly look up a config value for a given -# namespace, user, list, key tuple. +# namespace, user, list, key tuple. sub get_config_explicitly { my ($self, $namespace, $user_id, $list_id, $key) = @_; - # just to be sure $user_id ||= ''; $list_id ||= ''; my $where = { user_id => $user_id, - list_id => $list_id, - key => $key, - namespace => $namespace }; + list_id => $list_id, + key => $key, + namespace => $namespace }; my @results = $self->_get_rows(table => 'config', - where => $where, + where => $where, columns => ['value']); return $results[0]->{value};
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52