Deprecating executeUnbuffered() in favor of execute()
authorAlexander Ebert <ebert@woltlab.com>
Fri, 19 Sep 2014 10:26:07 +0000 (12:26 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 19 Sep 2014 10:26:07 +0000 (12:26 +0200)
The method origins from the early days and does not differ from execute() anyway. For now it just forwards the call, but will be removed in future releases.

wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php
wcfsetup/install/files/lib/system/WCFSetup.class.php
wcfsetup/install/files/lib/system/database/statement/PreparedStatement.class.php

index ebf42211c3b3123c418073120784c489b27c9535..f51b6eaf6ad7e292caaa74c8297943b229a68ed7 100644 (file)
@@ -109,7 +109,7 @@ abstract class DatabaseObjectEditor extends DatabaseObjectDecorator implements I
                $affectedCount = 0;
                WCF::getDB()->beginTransaction();
                foreach ($objectIDs as $objectID) {
-                       $statement->executeUnbuffered(array($objectID));
+                       $statement->execute(array($objectID));
                        $affectedCount += $statement->getAffectedRows();
                }
                WCF::getDB()->commitTransaction();
index 933c3b38acf1dbb001a55c9fb12346f88aa7b4a4..1037d4a45288dc3cafc5a4a1074040fcc078b6b7 100644 (file)
@@ -815,7 +815,7 @@ class WCFSetup extends WCF {
                        
                        self::getDB()->beginTransaction();
                        foreach ($acpTemplateInserts as $acpTemplate) {
-                               $statement->executeUnbuffered(array($acpTemplate, 'wcf'));
+                               $statement->execute(array($acpTemplate, 'wcf'));
                        }
                        self::getDB()->commitTransaction();
                }
@@ -829,7 +829,7 @@ class WCFSetup extends WCF {
                        
                        self::getDB()->beginTransaction();
                        foreach ($fileInserts as $file) {
-                               $statement->executeUnbuffered(array($file, 'wcf'));
+                               $statement->execute(array($file, 'wcf'));
                        }
                        self::getDB()->commitTransaction();
                }
index 03bb33abbba28b5179dd3fba9bf793f9003389ba..86e552ce012299aac8089aed554a219d841a6da6 100644 (file)
@@ -101,25 +101,11 @@ class PreparedStatement {
        /**
         * Executes a prepared statement.
         * 
+        * @deprecated  2.1 - Please use execute() instead
         * @param       array           $parameters
         */
        public function executeUnbuffered(array $parameters = array()) {
-               $this->parameters = $parameters;
-               $this->database->incrementQueryCount();
-               
-               try {
-                       if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->start($this->query, Benchmark::TYPE_SQL_QUERY);
-                       
-                       if (empty($parameters)) $this->pdoStatement->execute();
-                       else $this->pdoStatement->execute($parameters);
-                       
-                       if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->stop();
-               }
-               catch (\PDOException $e) {
-                       if (WCF::benchmarkIsEnabled()) Benchmark::getInstance()->stop();
-                       
-                       throw new DatabaseException('Could not execute prepared statement: '.$e->getMessage(), $this->database, $this);
-               }
+               $this->execute($parameters);
        }
        
        /**