mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-02-13 13:59:28 +02:00
Removed Moose from the Db object.
This commit is contained in:
parent
2c173ba53e
commit
aafc0fef69
@ -35,7 +35,6 @@ apt-get install postgresql-server-dev-9.3
|
||||
4. Install required Perl modules:
|
||||
```
|
||||
cpanm JSON
|
||||
cpanm Moose
|
||||
cpanm Net::OpenSSH
|
||||
cpanm DBI
|
||||
cpanm DBD::Pg
|
||||
|
@ -6,7 +6,9 @@ PgBackRest aims to be a simple backup and restore system that can seamlessly sca
|
||||
|
||||
### v0.31: ???
|
||||
|
||||
* Added option (--no-start-stop) to allow backups when Postgres is shut down. If postmaster.pid is present then --force is required to make the backup run (though is Postgres is running an inconsistent backup will likely be created).
|
||||
* Added option (--no-start-stop) to allow backups when Postgres is shut down. If postmaster.pid is present then --force is required to make the backup run (though is Postgres is running an inconsistent backup will likely be created). This option was added primarily for the purpose of unit testing, but there may be applications in the real world as well.
|
||||
|
||||
* Removed dependency on Moose. It wasn't being used extensively and makes for longer startup times.
|
||||
|
||||
### v0.30: core restructuring and unit tests
|
||||
|
||||
|
@ -658,12 +658,11 @@ my $oDb;
|
||||
|
||||
if (!$bNoStartStop)
|
||||
{
|
||||
$oDb = BackRest::Db->new
|
||||
$oDb = new BackRest::Db
|
||||
(
|
||||
strDbUser => config_key_load(CONFIG_SECTION_STANZA, CONFIG_KEY_USER),
|
||||
strDbHost => config_key_load(CONFIG_SECTION_STANZA, CONFIG_KEY_HOST),
|
||||
strCommandPsql => config_key_load(CONFIG_SECTION_COMMAND, CONFIG_KEY_PSQL),
|
||||
oDbSSH => $oFile->{oDbSSH}
|
||||
config_key_load(CONFIG_SECTION_COMMAND, CONFIG_KEY_PSQL),
|
||||
config_key_load(CONFIG_SECTION_STANZA, CONFIG_KEY_HOST),
|
||||
config_key_load(CONFIG_SECTION_STANZA, CONFIG_KEY_USER)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@ use strict;
|
||||
use warnings;
|
||||
use Carp;
|
||||
|
||||
use Moose;
|
||||
use Net::OpenSSH;
|
||||
use File::Basename;
|
||||
use IPC::System::Simple qw(capture);
|
||||
@ -16,21 +15,24 @@ use IPC::System::Simple qw(capture);
|
||||
use lib dirname($0);
|
||||
use BackRest::Utility;
|
||||
|
||||
# Command strings
|
||||
has strCommandPsql => (is => 'bare'); # PSQL command
|
||||
|
||||
# Module variables
|
||||
has strDbUser => (is => 'ro'); # Database user
|
||||
has strDbHost => (is => 'ro'); # Database host
|
||||
has oDbSSH => (is => 'bare'); # Database SSH object
|
||||
has fVersion => (is => 'ro'); # Database version
|
||||
|
||||
####################################################################################################################################
|
||||
# CONSTRUCTOR
|
||||
####################################################################################################################################
|
||||
sub BUILD
|
||||
sub new
|
||||
{
|
||||
my $self = shift;
|
||||
my $class = shift; # Class name
|
||||
my $strCommandPsql = shift; # PSQL command
|
||||
my $strDbHost = shift; # Database host name
|
||||
my $strDbUser = shift; # Database user name (generally postgres)
|
||||
|
||||
# Create the class hash
|
||||
my $self = {};
|
||||
bless $self, $class;
|
||||
|
||||
# Initialize variables
|
||||
$self->{strCommandPsql} = $strCommandPsql;
|
||||
$self->{strDbHost} = $strDbHost;
|
||||
$self->{strDbUser} = $strDbUser;
|
||||
|
||||
# Connect SSH object if db host is defined
|
||||
if (defined($self->{strDbHost}) && !defined($self->{oDbSSH}))
|
||||
@ -44,6 +46,8 @@ sub BUILD
|
||||
master_opts => [-o => $strOptionSSHRequestTTY]);
|
||||
$self->{oDbSSH}->error and confess &log(ERROR, "unable to connect to $self->{strDbHost}: " . $self->{oDbSSH}->error);
|
||||
}
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
####################################################################################################################################
|
||||
@ -148,5 +152,4 @@ sub backup_stop
|
||||
"copy (select pg_xlogfile_name(xlog) from pg_stop_backup() as xlog) to stdout"))
|
||||
}
|
||||
|
||||
no Moose;
|
||||
__PACKAGE__->meta->make_immutable;
|
||||
1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user