]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Added PDO connection option for mysql driver
authorDavide Franco <bacula-dev@dflc.ch>
Mon, 18 Jul 2011 07:44:32 +0000 (09:44 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:25 +0000 (14:49 +0200)
gui/bacula-web/includes/db/cdb.class.php

index f46931c6dfb6e4636d7f72da002f67a387027c66..1c7304b4d5c572b572ef6acb41ba6213d01e8a72 100644 (file)
@@ -34,8 +34,7 @@ class CDB
                
                $this->options  = array(        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
                                                                        PDO::ATTR_CASE => PDO::CASE_LOWER,
-                                                                       PDO::ATTR_STATEMENT_CLASS => array('CDBResult', array($this) ),
-                                                                       PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true );
+                                                                       PDO::ATTR_STATEMENT_CLASS => array('CDBResult', array($this) ) );
        }
        
        public function makeConnection()
@@ -53,6 +52,9 @@ class CDB
        {
                foreach( $this->options as $option => $value )
                        $this->connection->setAttribute( $option, $value);
+               
+               if( $this->getDriver() == 'mysql' )
+                       $this->connection->setAttribute( PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true );
        }
        
        public function getDriver()