Advertisement
Guest User

Untitled

a guest
Jan 14th, 2014
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.41 KB | None | 0 0
  1. sub startup{
  2.     #
  3.     # Skip
  4.     #
  5.     my $connector = DBIx::Connector->new(
  6.             "dbi:mysql:database=".$self->{config}->{db}->{name}.';host='.$self->{config}->{db}->{host}.';port='.$self->{config}->{db}->{port},
  7.             $self->{config}->{db}->{user},
  8.             $self->{config}->{db}->{pass},
  9.         { AutoCommit => 1, }
  10.     );
  11.     $self->attr(dbh => sub {$connector->dbh});
  12.     $self->helper('db' => sub { return shift->app->dbh });
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement