continue;
}
// .my.sql but not .pg.sql
- if (preg_match('/#.[a-z]{2}\.sql#i', basename($bfn))
- && !preg_match('/#\.my\.sql#i', basename($bfn))
+ if (preg_match('#\.[a-z]{2}\.sql#i', basename($fn))
+ && !preg_match('#\.my\.sql#i', basename($fn))
) { // skip migration scripts at present..
continue;
}
}
-
-
- foreach($ar as $m) {
-
-
- }
}
// files ending in .pg.sql are native postgres files..
$fn = preg_match('#\.pg\.sql$#', basename($bfn)) ? false : $this->convertToPG($bfn);
- $cmd = "$psql_cmd -f " . escapeshellarg($fn ? $fn : $bfn) . ' 2>&1' ;
+ $cmd = "$psql_cmd < " . escapeshellarg($fn ? $fn : $bfn) . ' 2>&1' ;
echo "$bfn: $cmd ". ($this->cli ? "\n" : "<BR>\n");
unlink($fn);
}
}
+
+
+
+ $fd = $this->rootDir. "/Pman/$m/sql";
+ // sql directory - we try to convert..
+ foreach(glob($fd.'/*.sql') as $bfn) {
+ $fn = $this->convertToPG($bfn);
+ $cmd = "$psql_cmd < " . escapeshellarg($fn) ;
+ echo $cmd. ($this->cli ? "\n" : "<BR>\n");
+ passthru($cmd);
+ }
+
+ // postgres specific directory..
+
+ $fd = $this->rootDir. "/Pman/$m/pgsql";
+
+ foreach(glob($fd.'/*.sql') as $fn) {
+ $cmd = "$psql_cmd < " . escapeshellarg($fn) ;
+ echo $cmd. ($this->cli ? "\n" : "<BR>\n");
+ passthru($cmd);
+ }
+
+
+
}
}