More work to make the db scripts general
git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@266 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
@echo off
|
@echo off
|
||||||
%~dp0\scripts\sitelink2pmgr.pl %~dp0\db\schema.sql %~dp0db\vss.mdb > NUL
|
%~dp0\scripts\sitelink2pmgr.pl %~dp0\db\schema.sql %~dp0db\vss.mdb %* > NUL
|
||||||
echo Done!
|
echo Done!
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ my $sdbh = DBI->connect("dbi:ADO:$sdsn", undef, undef, {PrintError => 1,
|
|||||||
my($hostname, $database, $user, $password) = ('localhost',
|
my($hostname, $database, $user, $password) = ('localhost',
|
||||||
'property_manager',
|
'property_manager',
|
||||||
'pmgr', 'pmgruser');
|
'pmgr', 'pmgruser');
|
||||||
|
|
||||||
|
$database = shift if @ARGV;
|
||||||
|
$user = shift if @ARGV;
|
||||||
|
$password = shift if @ARGV;
|
||||||
|
|
||||||
print STDERR "Connecting to $database as $user\n";
|
print STDERR "Connecting to $database as $user\n";
|
||||||
my $db_handle = DBI->connect("DBI:mysql:database=$database;host=$hostname",
|
my $db_handle = DBI->connect("DBI:mysql:database=$database;host=$hostname",
|
||||||
$user, $password,
|
$user, $password,
|
||||||
|
|||||||
@@ -64,9 +64,13 @@ class AppController extends Controller {
|
|||||||
Configure::write('debug', '0');
|
Configure::write('debug', '0');
|
||||||
$script = $_SERVER['DOCUMENT_ROOT'] . '/pmgr/build.cmd';
|
$script = $_SERVER['DOCUMENT_ROOT'] . '/pmgr/build.cmd';
|
||||||
echo "<P>" . date('r') . "\n";
|
echo "<P>" . date('r') . "\n";
|
||||||
echo "<P>Script: $script" . "\n";
|
//echo "<P>Script: $script" . "\n";
|
||||||
|
$db = & $this->Account->getDataSource();
|
||||||
|
$script .= ' "' . $db->config['database'] . '"';
|
||||||
|
$script .= ' "' . $db->config['login'] . '"';
|
||||||
|
$script .= ' "' . $db->config['password'] . '"';
|
||||||
$handle = popen($script . ' 2>&1', 'r');
|
$handle = popen($script . ' 2>&1', 'r');
|
||||||
echo "<P>Handle: $handle; " . gettype($handle) . "\n";
|
//echo "<P>Handle: $handle; " . gettype($handle) . "\n";
|
||||||
echo "<P><PRE>\n";
|
echo "<P><PRE>\n";
|
||||||
while (($read = fread($handle, 2096))) {
|
while (($read = fread($handle, 2096))) {
|
||||||
echo $read;
|
echo $read;
|
||||||
|
|||||||
Reference in New Issue
Block a user