diff options
Diffstat (limited to 'lib/private/migration/content.php')
-rw-r--r-- | lib/private/migration/content.php | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/lib/private/migration/content.php b/lib/private/migration/content.php index 4413d722731..389dd8fc74f 100644 --- a/lib/private/migration/content.php +++ b/lib/private/migration/content.php @@ -27,7 +27,7 @@ class OC_Migration_Content{ private $zip=false; - // Holds the MDB2 object + // Holds the database object private $db=null; // Holds an array of tmpfiles to delete after zip creation private $tmpfiles=array(); @@ -35,7 +35,7 @@ class OC_Migration_Content{ /** * @brief sets up the * @param $zip ZipArchive object - * @param optional $db a MDB2 database object (required for exporttype user) + * @param optional $db a database object (required for exporttype user) * @return bool */ public function __construct( $zip, $db=null ) { @@ -64,16 +64,7 @@ class OC_Migration_Content{ // Optimize the query $query = $this->db->prepare( $query ); - // Die if we have an error (error means: bad query, not 0 results!) - if( PEAR::isError( $query ) ) { - $entry = 'DB Error: "'.$query->getMessage().'"<br />'; - $entry .= 'Offending command was: '.$query.'<br />'; - OC_Log::write( 'migration', $entry, OC_Log::FATAL ); - return false; - } else { - return $query; - } - + return $query; } /** @@ -156,20 +147,14 @@ class OC_Migration_Content{ $sql .= $valuessql . " )"; // Make the query $query = $this->prepare( $sql ); - if( !$query ) { - OC_Log::write( 'migration', 'Invalid sql produced: '.$sql, OC_Log::FATAL ); - return false; - exit(); + $query->execute( $values ); + // Do we need to return some values? + if( array_key_exists( 'idcol', $options ) ) { + // Yes we do + $return[] = $row[$options['idcol']]; } else { - $query->execute( $values ); - // Do we need to return some values? - if( array_key_exists( 'idcol', $options ) ) { - // Yes we do - $return[] = $row[$options['idcol']]; - } else { - // Take a guess and return the first field :) - $return[] = reset($row); - } + // Take a guess and return the first field :) + $return[] = reset($row); } $fields = ''; $values = ''; |