Return to Snippet

Revision: 18492
at September 30, 2009 18:59 by skwok


Initial Code
static public function executeUpdate($sql)
  {
    $con = Propel::getConnection();
    $con->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);

    return $con instanceof PropelPDO ? $con->exec($sql) : $con->executeUpdate($sql);
  }

  static public static function executeQuery($sql, $fetchmode = null)
  {
    $con = Propel::getConnection();
    $con->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
    
    if ($con instanceof PropelPDO)
    {
      $stmt = $con->prepare($sql);
      $stmt->execute();

      return $stmt;
    }
    else
    {
      return $con->executeQuery($sql, $fetchmode);
    }
  }

Initial URL


Initial Description
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:

Initial Title
sfPropelMigrationsLightPlugin patch for Symfony 1.2

Initial Tags


Initial Language
PHP