diff options
author | Tom Needham <needham.thomas@gmail.com> | 2012-09-18 16:25:34 +0000 |
---|---|---|
committer | Tom Needham <needham.thomas@gmail.com> | 2012-09-18 16:25:34 +0000 |
commit | 30188847a32b11efe86efbdda46ac480fb170493 (patch) | |
tree | 62a07ed4ede234a99a5cdbfbfdef6ca990355c21 /lib/migration | |
parent | be76a55ef035112d699442335ae214cb65f34791 (diff) | |
download | nextcloud-server-30188847a32b11efe86efbdda46ac480fb170493.tar.gz nextcloud-server-30188847a32b11efe86efbdda46ac480fb170493.zip |
Only try to delete migration.db if it was created.
Diffstat (limited to 'lib/migration')
-rw-r--r-- | lib/migration/content.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/migration/content.php b/lib/migration/content.php index 64b8168cd98..89b1e782d86 100644 --- a/lib/migration/content.php +++ b/lib/migration/content.php @@ -30,7 +30,7 @@ class OC_Migration_Content{ // Holds the MDB2 object private $db=null; // Holds an array of tmpfiles to delete after zip creation - private $tmpfiles=false; + private $tmpfiles=array(); /** * @brief sets up the @@ -43,18 +43,21 @@ class OC_Migration_Content{ $this->zip = $zip; $this->db = $db; - if( !is_null( $db ) ) { - // Get db path - $db = $this->db->getDatabase(); - $this->tmpfiles[] = $db; - } - } // @brief prepares the db // @param $query the sql query to prepare public function prepare( $query ) { - + + // Only add database to tmpfiles if actually used + if( !is_null( $this->db ) ) { + // Get db path + $db = $this->db->getDatabase(); + if(!in_array($db, $this->tmpfiles)){ + $this->tmpfiles[] = $db; + } + } + // Optimize the query $query = $this->processQuery( $query ); |