Koha-Contrib-Sudoc

 view release on metacpan or  search on metacpan

lib/Koha/Contrib/Sudoc/Koha.pm  view on Meta::CPAN

    my $c = $self->conf->{config};
    $self->dbh( DBI->connect(
        "DBI:"     . $c->{db_scheme} .
        ":dbname=" . $c->{database} .
        ";host="   . $c->{hostname} .
        ";port="   . $c->{port},
        $c->{user}, $c->{pass} )
    ) or carp $DBI::errstr;
    if ( $c->{db_scheme} eq 'mysql' ) {
        # Force utf8 communication between MySQL and koha
        $self->dbh->{ mysql_enable_utf8 } = 1;
        $self->dbh->do( "set NAMES 'utf8'" );
        my $tz = $ENV{TZ};
        ($tz) and $self->dbh->do( qq(SET time_zone = "$tz") );
    }

    if ( C4::Context->preference('SearchEngine') eq 'Elasticsearch' ) {
        my $param = $c->{elasticsearch};
        my $es = Search::Elasticsearch->new( nodes => $param->{server} );
        $self->es( $es );
        $self->es_index( {



( run in 0.309 second using v1.01-cache-2.11-cpan-00829025b61 )