Bug 29196: (Bug 27068 follow-up) - Remove unnecessary check
[srvgit] / misc / exportauth.pl
old mode 100644 (file)
new mode 100755 (executable)
index b1dad03..14e3088
@@ -4,28 +4,20 @@
 #
 
 use strict;
-require Exporter;
+#use warnings; FIXME - Bug 2505
 
-use C4::Auth;
-use C4::Output;  # contains gettemplate
-use C4::Biblio;
-use CGI;
+use Koha::Script;
+use C4::Context;
 use C4::Auth;
 my $outfile = $ARGV[0];
-open(OUT,">$outfile") or die $!;
-my $query = new CGI;
-my $dbh=DBI->connect("DBI:mysql:database=koha2;host=localhost;port=3306","kohaserver","kohaserver") or die $DBI::errmsg;
-#$dbh->do("set character_set_client='latin5'");        
-#$dbh->do("set character_set_connection='utf8'");
-#$dbh->do("set character_set_results='latin5'");               
-#my $dbh=C4::Context->dbh;
-       my $sth;
-       
-               $sth=$dbh->prepare("select marc from auth_header order by authid");
-               $sth->execute();
-       
-       while (my ($marc) = $sth->fetchrow) {
-
-               print OUT $marc;
-       }
-close(OUT);
+open(my $fh, '>', $outfile) or die $!;
+my $dbh=C4::Context->dbh;
+#$dbh->do("set character_set_client='latin5'"); 
+$dbh->do("set character_set_connection='utf8'");
+#$dbh->do("set character_set_results='latin5'");        
+my $sth=$dbh->prepare("select marc from auth_header order by authid");
+$sth->execute();
+while (my ($marc) = $sth->fetchrow) {
+    print $fh $marc;
+ }
+close($fh);