packaging one directory
|
1 |
package DBIx::Custom::MySQL; |
2 | ||
3 |
use strict; |
|
removed DESTROY method(not b...
|
4 |
use warnings; |
update document
|
5 | |
update document
|
6 |
use base 'DBIx::Custom'; |
7 | ||
8 |
__PACKAGE__->attr([qw/database host port/]); |
|
9 | ||
packaging one directory
|
10 |
sub connect { |
update document
|
11 |
my $proto = shift; |
12 |
|
|
cleanup
|
13 |
# Create a new object |
update document
|
14 |
my $self = ref $proto ? $proto : $proto->new(@_); |
packaging one directory
|
15 |
|
cleanup
|
16 |
# Data source |
add port and host method
|
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
|
26 |
} |
27 |
|
|
28 |
return $self->SUPER::connect; |
|
29 |
} |
|
30 | ||
removed register_format()
|
31 |
1; |
32 | ||
packaging one directory
|
33 |
=head1 NAME |
34 | ||
added table not specified ex...
|
35 |
DBIx::Custom::MySQL - DEPRECATED! |
packaging one directory
|
36 |