Posted By

skwok on 09/30/09


Tagged

patch symfony sfPropelMigrationsLightPlugin


Versions (?)

sfPropelMigrationsLightPlugin patch for Symfony 1.2


 / Published in: PHP
 

Patch for sfPropelMigrationsLightPlugin 1.1.2 installed on Symfony 1.2. In sfMigrator.class.php, add "$con->setAttribute(PDO::MYSQLATTRUSEBUFFEREDQUERY, true);" to the following functions:

  1. static public function executeUpdate($sql)
  2. {
  3. $con = Propel::getConnection();
  4. $con->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
  5.  
  6. return $con instanceof PropelPDO ? $con->exec($sql) : $con->executeUpdate($sql);
  7. }
  8.  
  9. static public static function executeQuery($sql, $fetchmode = null)
  10. {
  11. $con = Propel::getConnection();
  12. $con->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
  13.  
  14. if ($con instanceof PropelPDO)
  15. {
  16. $stmt = $con->prepare($sql);
  17. $stmt->execute();
  18.  
  19. return $stmt;
  20. }
  21. else
  22. {
  23. return $con->executeQuery($sql, $fetchmode);
  24. }
  25. }

Report this snippet  

You need to login to post a comment.