View | Details | Raw Unified | Return to bug 11634
Collapse All | Expand All

(-)a/Koha/Database.pm (-10 / +1 lines)
Lines 46-61 __PACKAGE__->mk_accessors(qw( )); Link Here
46
# returns it.
46
# returns it.
47
sub _new_schema {
47
sub _new_schema {
48
    my $context = C4::Context->new();
48
    my $context = C4::Context->new();
49
    my $db_driver = C4::Context::db_scheme2dbi($context->config("db_scheme"));
49
    my $schema = Koha::Schema->connect( sub { $context->dbh } );
50
51
    my $db_name   = $context->config("database");
52
    my $db_host   = $context->config("hostname");
53
    my $db_port   = $context->config("port") || '';
54
    my $db_user   = $context->config("user");
55
    my $db_passwd = $context->config("pass");
56
    my $schema    = Koha::Schema->connect(
57
        "DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",
58
        $db_user, $db_passwd );
59
    return $schema;
50
    return $schema;
60
}
51
}
61
52
(-)a/Koha/Schema.pm (-1 / +1 lines)
Lines 15-20 __PACKAGE__->load_namespaces; Link Here
15
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
15
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
16
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oDUxXckmfk6H9YCjW8PZTw
16
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oDUxXckmfk6H9YCjW8PZTw
17
17
18
__PACKAGE__->storage_type('Koha::Storage');
18
19
19
# You can replace this text with custom content, and it will be preserved on regeneration
20
1;
20
1;
(-)a/Koha/Storage.pm (-1 / +19 lines)
Line 0 Link Here
0
- 
1
use utf8;
2
package Koha::Storage;
3
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7
use strict;
8
use warnings;
9
10
use base 'DBIx::Class::Storage::DBI';
11
sub DESTROY {
12
    my $self = shift;
13
14
    # destroy just the object if not native to this process/thread
15
    $self->_preserve_foreign_dbh;
16
17
    $self->_dbh(undef);
18
}
19
1;

Return to bug 11634