From 5579abe1fcd6e31987cf053e1ca2a77801b981c7 Mon Sep 17 00:00:00 2001 From: slef Date: Sun, 1 Jul 2007 18:43:57 +0000 Subject: [PATCH] Use DBI not mysql command-line to load the database tables --- installer/install.pl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/installer/install.pl b/installer/install.pl index b4ae8d3913..5f9c18215e 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -334,13 +334,14 @@ if ($step && $step==1){ $template->param($op=>1) }elsif ($op && $op eq 'importdatastructure'){ #Import data structure and show errors if any - my $filename="kohastructure.sql"; - undef $/; - my $strcmd="mysql ".($info{hostname}?"-h $info{hostname} ":"").($info{port}?"-P $info{port} ":"").($info{user}?"-u $info{user} ":"").($info{password}?"-p$info{password}":"")." $info{dbname} "; - my $str = qx($strcmd < $filename 2>&1); - $str=~s/\n|\r/
/g; - $template->param("error"=>$str , + #Uses DBI to read the file [MJR 2007-07-01] + my $dbh= DBI->connect("DBI:$info{dbms}:$info{dbname}:$info{hostname}".($info{port}?":$info{port}":""),$info{'user'}, $info{'password'}); + open(INPUT,"do($_); } split(/;/,join('',)); + close(INPUT); + $template->param("error"=>$dbh->errstr , "$op"=> 1, ); + $dbh->disconnect; } else { #Check if there are enough tables. # Version 2_2 was 74 tables, so we check if there is more than 75 -- 2.39.5