DataObjects/Builder_tables.php
authorEdward <edward@roojs.com>
Fri, 9 May 2014 06:58:35 +0000 (14:58 +0800)
committerEdward <edward@roojs.com>
Fri, 9 May 2014 06:58:35 +0000 (14:58 +0800)
DataObjects/Builder_tables.php

index 80e2391..7c90b82 100644 (file)
@@ -213,8 +213,20 @@ class Pman_Builder_DataObjects_Builder_tables extends DB_DataObject
         
         $cmd = "mysqldump -uroot --no-create-info summit cal_event";
         
+        require_once 'System.php';
+            
+        $tmpdir  = System::mktemp("-d remote_upload");
+
+        $path = $tmpdir . '/' . $tn . '.sql';
+        
+        header ('Content-Type: application/octet-stream');
+        header("Content-Disposition: attachment; filename=\"".$path."\";" );
+        @ob_clean();
+        flush();
+        readfile($src);
+        
         
-        echo passthru($cmd);;exit;
+//        echo passthru($cmd);;exit;
                 
                 exit;