]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove db tmp file after export creation
authorTom Needham <needham.thomas@gmail.com>
Sat, 31 Mar 2012 23:20:08 +0000 (23:20 +0000)
committerTom Needham <needham.thomas@gmail.com>
Sat, 31 Mar 2012 23:20:08 +0000 (23:20 +0000)
lib/migration/content.php

index d25b5af293c7cb409abd3cee5468567d807e9aa5..a9fa05596b3b36cf4602e6d38e9bafde2d9b541e 100644 (file)
@@ -28,7 +28,7 @@ class OC_Migration_Content{
        
        private $zip=false;
        // Holds the MDB2 object
-       private $db=false;
+       private $db=null;
        // Holds an array of tmpfiles to delete after zip creation
        private $tmpfiles=false;
        
@@ -38,11 +38,18 @@ class OC_Migration_Content{
        * @param optional $db a MDB2 database object (required for exporttype user)
        * @return bool
        */
-       public function __construct( $zip, $db=false ){
+       public function __construct( $zip, $db=null ){
 
                $this->zip = $zip;
                $this->db = $db;
                
+               if( !is_null( $db ) ){
+                       // Get db path
+                       $db = $this->db->getDatabase();
+                       $this->tmpfiles[] = $db;
+                       OC_Log::write('user-migrate',$db, OC_Log::INFO);
+               }
+               
        }
        
        // @breif prepares the db