[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[6932] branches/1.3/LedgerSMB/Database.pm
- Subject: SF.net SVN: ledger-smb:[6932] branches/1.3/LedgerSMB/Database.pm
- From: ..hidden..
- Date: Sun, 16 Mar 2014 21:59:36 +0000
Revision: 6932
http://sourceforge.net/p/ledger-smb/code/6932
Author: jame
Date: 2014-03-16 21:59:34 +0000 (Sun, 16 Mar 2014)
Log Message:
-----------
Corrected POD syntax errors in LedgerSMB/Database.pm
Modified Paths:
--------------
branches/1.3/LedgerSMB/Database.pm
Modified: branches/1.3/LedgerSMB/Database.pm
===================================================================
--- branches/1.3/LedgerSMB/Database.pm 2014-03-16 21:55:59 UTC (rev 6931)
+++ branches/1.3/LedgerSMB/Database.pm 2014-03-16 21:59:34 UTC (rev 6932)
@@ -15,8 +15,6 @@
=head1 METHODS
-=over
-
=cut
# Methods are documented inline.
@@ -43,6 +41,8 @@
my $logger = Log::Log4perl->get_logger('LedgerSMB::Database');
+=over
+
=item LedgerSMB::Database->new({dbname = $dbname, countrycode = $cc, chart_name = $name, company_name = $company, username = $username, password = $password})
This function creates a new database management object with the specified
@@ -57,6 +57,8 @@
however, it will attempt to copy all attributes beginning with _ into the
current object (_user, _locale, etc).
+=back
+
=cut
sub new {
@@ -77,6 +79,8 @@
return $self;
}
+=over
+
=item base_backup
This routine connects to the database using pg_dumpall and returns a plain text,
@@ -93,6 +97,8 @@
It returns the full path of the resulting backup file on success, or undef on
failure.
+=back
+
=cut
sub base_backup {
@@ -126,6 +132,8 @@
return $backupfile;
}
+=over
+
=item db_backup()
This routine connects to the database using pg_dump and creates a Pg-native
@@ -140,6 +148,8 @@
It returns the full path of the resulting backup file on success, or undef on
failure.
+=back
+
=cut
sub db_backup {
@@ -173,6 +183,8 @@
return $backupfile;
}
+=over
+
=item get_info()
This routine connects to the database using DBI and attempts to determine if a
@@ -182,9 +194,11 @@
=over
=item username
+
Set to the user of the current connection
=item appname
+
Set to the current application name, one of:
=over
@@ -198,11 +212,13 @@
=back
=item version
+
The current version of the application. One of:
=over
=item legacy
+
SQL-Ledger 2.6 and below, and LedgerSMB 1.1 and below
=item 1.2 (LedgerSMB only)
@@ -220,18 +236,23 @@
=over
=item full_version
+
The full version number of the database version
=item status
+
Current status of the db. One of:
=item exists
+
The database was confirmed to exist
=item does not exist
+
The database was confirmed to not exist
=item undef
+
The database could not be confirmed to exist, or not
=back
@@ -271,6 +292,8 @@
2.6.x and prior are lumped under appname => 'ledgersmb' and version => 'legacy',
though the fullversion may give you an idea of what the actual version is run.
+=back
+
=cut
sub get_info {
@@ -395,10 +418,14 @@
return $retval;
}
+=over
+
=item $db->server_version();
Connects to the server and returns the version number in x.y.z format.
+=back
+
=cut
sub server_version {
@@ -415,6 +442,8 @@
return $retval;
}
+=over
+
=item $db->list()
Lists available databases except for those named "postgres" or starting with
@@ -422,6 +451,8 @@
Returns a list of strings of db names.
+=back
+
=cut
sub list {
@@ -445,8 +476,8 @@
return @results;
}
+=over
-
=item $db->create();
Creates a database and loads the contrib files. This is done from template0,
@@ -459,6 +490,8 @@
In DEBUG mode, will show all lines to STDERR. In ERROR logging mode, will
display only those lines containing the word ERROR.
+=back
+
=cut
sub create {
@@ -507,10 +540,14 @@
return $rc;
}
+=over
+
=item $db->copy('new_name')
Copies the existing database to a new name.
+=back
+
=cut
sub copy {
@@ -524,12 +561,16 @@
my $rc = $dbh->do("CREATE DATABASE $new_name WITH TEMPLATE $dbname");
$dbh->disconnect;
return $rc;
-}
+}
+=over
+
=item $db->load_modules($loadorder)
Loads or reloads sql modules from $loadorder
+=back
+
=cut
sub load_modules {
@@ -548,11 +589,15 @@
close (LOADORDER);
}
+=over
+
=item $db->exec_script({script => 'path/to/file', logfile => 'path/to/log'})
Executes the script. Returns 0 if successful, 1 if there are errors suggesting
that types are already created, and 2 if there are other errors.
+=back
+
=cut
sub exec_script {
@@ -575,10 +620,14 @@
return $test;
}
+=over
+
=item $db->create_and_load();
Creates a database and then loads it.
+=back
+
=cut
sub create_and_load(){
@@ -587,11 +636,14 @@
$self->load_modules('LOADORDER');
}
+=over
=item $db->process_roles($rolefile);
Loads database Roles templates.
+=back
+
=cut
sub process_roles {
@@ -630,6 +682,8 @@
log => "$temp/dblog"});
}
+=over
+
=item $db->lsmb_info()
This routine retrieves general stats about the database and returns the output
@@ -655,6 +709,8 @@
=back
+=back
+
=cut
sub lsmb_info {
@@ -678,14 +734,17 @@
}
return $retval;
}
-
+=over
+
=item $db->db_tests()
This routine runs general db tests.
TODO
+=back
+
=cut
#TODO
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits