Newer Older
36 lines | 0.771kb
packaging one directory
yuki-kimoto authored on 2009-11-16
1
package DBIx::Custom::MySQL;
2

            
3
use strict;
removed DESTROY method(not b...
yuki-kimoto authored on 2010-07-18
4
use warnings;
update document
yuki-kimoto authored on 2010-01-30
5

            
update document
yuki-kimoto authored on 2010-05-27
6
use base 'DBIx::Custom';
7

            
8
__PACKAGE__->attr([qw/database host port/]);
9

            
packaging one directory
yuki-kimoto authored on 2009-11-16
10
sub connect {
update document
yuki-kimoto authored on 2010-05-27
11
    my $proto = shift;
12
    
cleanup
yuki-kimoto authored on 2010-08-05
13
    # Create a new object
update document
yuki-kimoto authored on 2010-05-27
14
    my $self = ref $proto ? $proto : $proto->new(@_);
packaging one directory
yuki-kimoto authored on 2009-11-16
15
    
cleanup
yuki-kimoto authored on 2010-08-05
16
    # Data source
add port and host method
yuki-kimoto authored on 2009-11-16
17
    if (!$self->data_source) {
18
        my $database = $self->database;
19
        my $host     = $self->host;
20
        my $port     = $self->port;
21
        my $data_source = "dbi:mysql:";
22
        $data_source .= "database=$database;" if $database;
23
        $data_source .= "host=$host;"         if $host;
24
        $data_source .= "port=$port;"         if $port;
25
        $self->data_source($data_source);
packaging one directory
yuki-kimoto authored on 2009-11-16
26
    }
27
    
28
    return $self->SUPER::connect;
29
}
30

            
removed register_format()
yuki-kimoto authored on 2010-05-26
31
1;
32

            
packaging one directory
yuki-kimoto authored on 2009-11-16
33
=head1 NAME
34

            
added table not specified ex...
Yuki Kimoto authored on 2011-01-21
35
DBIx::Custom::MySQL - DEPRECATED!
packaging one directory
yuki-kimoto authored on 2009-11-16
36