Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Created by PhpStorm.
- * User: richard
- * Date: 3/7/17
- * Time: 12:15 PM
- *
- * Usage (in config.yml):
- * doctrine:
- * dbal:
- * driver_class: AppBundle\Service\DriverWithoutCache
- */
- namespace AppBundle\Service;
- use Doctrine\DBAL\DBALException;
- use Doctrine\DBAL\Driver\PDOException;
- use Doctrine\DBAL\Driver\PDOMySql\Driver;
- class DriverWithoutCache extends Driver
- {
- public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
- {
- try {
- $conn = parent::connect($params, $username, $password, $driverOptions);
- $conn->setAttribute(\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,false);
- } catch (PDOException $e) {
- throw DBALException::driverException($this, $e);
- }
- return $conn;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement