Bugzilla – Attachment 33571 Details for
Bug 13257
update_dbix_class_files.pl need a POD
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13257: update_dbix_class_files.pl need a POD
Bug-13257-updatedbixclassfilespl-need-a-POD.patch (text/plain), 2.77 KB, created by
Tomás Cohen Arazi (tcohen)
on 2014-11-14 14:39:40 UTC
(
hide
)
Description:
Bug 13257: update_dbix_class_files.pl need a POD
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2014-11-14 14:39:40 UTC
Size:
2.77 KB
patch
obsolete
>From 65ab6c141671193925892bdd453fca750256fe7b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Fri, 14 Nov 2014 11:38:48 -0300 >Subject: [PATCH] Bug 13257: update_dbix_class_files.pl need a POD > >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >--- > misc/devel/update_dbix_class_files.pl | 84 +++++++++++++++++++++++++++++++---- > 1 file changed, 76 insertions(+), 8 deletions(-) > >diff --git a/misc/devel/update_dbix_class_files.pl b/misc/devel/update_dbix_class_files.pl >index d231582..9b080e0 100755 >--- a/misc/devel/update_dbix_class_files.pl >+++ b/misc/devel/update_dbix_class_files.pl >@@ -19,16 +19,21 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >+ > use DBIx::Class::Schema::Loader qw/ make_schema_at /; >+ > use Getopt::Long; >+use Pod::Usage; > > my $path = "./"; > my $db_driver = 'mysql'; > my $db_host = 'localhost'; > my $db_port = '3306'; >-my $db_name = ''; >-my $db_user = ''; >-my $db_passwd = ''; >+my $db_name; >+my $db_user; >+my $db_passwd; >+my $help; >+ > GetOptions( > "path=s" => \$path, > "db_driver=s" => \$db_driver, >@@ -37,10 +42,73 @@ GetOptions( > "db_name=s" => \$db_name, > "db_user=s" => \$db_user, > "db_passwd=s" => \$db_passwd, >+ "h|help" => \$help > ); > >-make_schema_at( >- "Koha::Schema", >- { debug => 1, dump_directory => $path, preserve_case => 1 }, >- ["DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",$db_user, $db_passwd ] >-); >+# If we were asked for usage instructions, do it >+pod2usage(1) if defined $help; >+ >+if (! defined $db_name ) { >+ print "Error: \'db_name\' parameter is mandatory.\n"; >+ pod2usage(1); >+} else { >+ >+ make_schema_at( >+ "Koha::Schema", >+ { debug => 1, dump_directory => $path, preserve_case => 1 }, >+ ["DBI:$db_driver:dbname=$db_name;host=$db_host;port=$db_port",$db_user, $db_passwd ] >+ ); >+} >+ >+1; >+ >+=head1 NAME >+ >+misc/devel/update_dbix_class_files.pl >+ >+=head1 SYNOPSIS >+ >+ update_dbix_class_files.pl --db_name=db-name --db_user=db-user \ >+ --db_passwd=db-pass ... >+ >+The command in usually called from the root directory for the Koha source tree. >+If you are runing from another directory, use the --path switch to specify >+a different path. >+ >+=head1 OPTIONS >+ >+=over 8 >+ >+=item B<--db_name> >+ >+DB name. (mandatory) >+ >+=item B<--db_user> >+ >+DB user name. >+ >+=item B<--db_passwd> >+ >+DB password. >+ >+=item B<--db_driver> >+ >+DB driver to be used. (defaults to 'mysql') >+ >+=item B<--db_host> >+ >+hostname for the DB server. (defaults to 'localhost') >+ >+=item B<--db_port> >+ >+port number for the DB server. (defaults to '3306') >+ >+=item B<--path> >+ >+path into which create the schema files. (defaults to './') >+ >+=item B<-h|--help> >+ >+prints this help text >+ >+=back >\ No newline at end of file >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13257
: 33571