diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-11-22 15:53:56 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-11-22 15:53:56 +0100 |
commit | 9adff4f7f52df660ec066b896161e46abe7a9d5a (patch) | |
tree | ae734758115c7436fdc3db1c6a81fc3763e21cc0 /lib/private/migration | |
parent | 60cfdae50399c362edee204cb6849db8203a63b0 (diff) | |
download | nextcloud-server-9adff4f7f52df660ec066b896161e46abe7a9d5a.tar.gz nextcloud-server-9adff4f7f52df660ec066b896161e46abe7a9d5a.zip |
Change OC_Migrate from MDB2 to Doctrine
Diffstat (limited to 'lib/private/migration')
-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 = ''; |