sfPropelMigrationsLightPlugin patch for Symfony 1.2


/ Published in: PHP
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.