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 |
|
|
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 |
|
|
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 |
|
|