Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-560

Fix DBAL PostConnect code example in docs

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA1
    • Fix Version/s: 2.0-BETA2
    • Component/s: Documentation
    • Security Level: All
    • Labels:
      None

      Description

      Two small corrections to http://www.doctrine-project.org/documentation/manual/2_0/en/dbal:configuration:dbal-events#postconnect-event

      • There should be a semi-colon after new EventManager() instead of a comma
      • The parameter to the MysqlSessionInit constructor should be UTF8 and not UTF-8. The parameter with the dash causes a PDOException:
        SQLSTATE[42000]: Syntax error or access violation: 1115 Unknown character set: 'UTF'
      

      Corrected code:

      <?php
      
      $evm = new EventManager();
      $evm->addEventSubscriber(new MysqlSessionInit('UTF8'));
      
      $conn = DriverManager::getConnection($connectionParams, null, $evm);
      

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Marc Hodgins
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: