function importpgsqldir($url, $dir, $disable_triggers = false)
{
+ $ff = HTML_FlexyFramework::get();
+
require_once 'System.php';
$cat = System::which('cat');
$psql = System::which('psql');
echo $psql_cmd . "\n" ;
echo "scan : $dir\n";
+
if (is_file($dir)) {
$files = array($dir);
//usort($files, $lsort);
-
foreach($files as $bfn) {
$cmd = "$psql_cmd < " . escapeshellarg($fn ? $fn : $bfn) . ' 2>&1' ;
- echo "$bfn: $cmd ". ($this->cli ? "\n" : "<BR>\n");
-
+ echo "$bfn: $cmd ". ($ff->cli ? "\n" : "<BR>\n");
passthru($cmd);
}
+ function fixMysqlInnodb()
+ {
+ // innodb in single files is far more efficient that MYD or one big innodb file.
+ // first check if database is using this format.
+ $db = DB_DataObject::factory('core_enum');
+ $db->query("show variables like 'innodb_file_per_table'");
+ $db->fetch();
+ var_dump($db);
+ // Value should == ON
+
+ // I think it needs to look in the mysql directory.... to see if the idb exists..
+ $db = DB_DataObject::factory('core_enum');
+ $db->query("SHOW TABLE STATUS");
+ // Engine should be InnoDB - and file XXX.idb should exist...
+
+
+
+
+
+
+
+
+
+ }
+
+
/** ------------- schema fixing ... there is an issue with data imported having the wrong sequence names... --- */
function fixSequencesMysql()