/[A3C]/lib/Strix.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/Strix.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 177 by dpavlin, Mon Jun 16 19:05:05 2008 UTC revision 188 by dpavlin, Tue Jun 17 10:11:46 2008 UTC
# Line 9  __PACKAGE__->mk_accessors( qw(instance u Line 9  __PACKAGE__->mk_accessors( qw(instance u
9  use DBI;  use DBI;
10  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
11  use Carp qw/confess/;  use Carp qw/confess/;
12    use Jifty;
13    
14  our $debug = 0;  our $debug = 0;
15    
# Line 51  sub dbh { Line 52  sub dbh {
52    
53          Jifty->log->info("Connect to instance $instance with dsn $dsn");          Jifty->log->info("Connect to instance $instance with dsn $dsn");
54    
55          my $dbh = DBI->connect( $dsn, $database->{user}, $database->{passwd} ) or die $DBI::errstr;          my $dbh = DBI->connect( $dsn, $database->{user}, $database->{passwd} ) or die "$DBI::errstr\n";
56    
57            # force database to send us back UTF-8 no metter what it's encoding
58            $dbh->do("set client_encoding='utf-8'");
59            $dbh->{pg_enable_utf8} = 1;
60    
61          $instance_dbh->{$instance} = $dbh;          $instance_dbh->{$instance} = $dbh;
62    
# Line 235  sub site_navigation { Line 240  sub site_navigation {
240                  }                  }
241    
242                  my $depth = $kat->{depth};                  my $depth = $kat->{depth};
243                    if ( ! defined $pos[ $depth - 2 ] ) {
244                            warn "FIXING CATEGORY: ",dump( $kat );
245                            $node->{class} = "error";
246                            $depth--;
247                    }
248                  @pos = splice( @pos, 0, $depth );                  @pos = splice( @pos, 0, $depth );
249                  $pos[ $depth - 1 ]++;                  $pos[ $depth - 1 ]++;
250    

Legend:
Removed from v.177  
changed lines
  Added in v.188

  ViewVC Help
Powered by ViewVC 1.1.26