@@ 210-220 (lines=11) @@ | ||
207 | throw new \LogicException(sprintf('Database Url %s is invalid.', $databaseUrl)); |
|
208 | } |
|
209 | $platform = $conn->getDatabasePlatform()->getName(); |
|
210 | switch ($platform) { |
|
211 | case 'sqlite': |
|
212 | $sql = 'SELECT sqlite_version() AS server_version'; |
|
213 | break; |
|
214 | case 'mysql': |
|
215 | $sql = 'SELECT version() AS server_version'; |
|
216 | break; |
|
217 | case 'postgresql': |
|
218 | default: |
|
219 | $sql = 'SHOW server_version'; |
|
220 | } |
|
221 | $stmt = $conn->executeQuery($sql); |
|
222 | $version = $stmt->fetchColumn(); |
|
223 |
@@ 1011-1023 (lines=13) @@ | ||
1008 | $rsm->addScalarResult('server_version', 'server_version'); |
|
1009 | ||
1010 | $platform = $em->getConnection()->getDatabasePlatform()->getName(); |
|
1011 | switch ($platform) { |
|
1012 | case 'sqlite': |
|
1013 | $sql = 'SELECT sqlite_version() AS server_version'; |
|
1014 | break; |
|
1015 | ||
1016 | case 'mysql': |
|
1017 | $sql = 'SELECT version() AS server_version'; |
|
1018 | break; |
|
1019 | ||
1020 | case 'postgresql': |
|
1021 | default: |
|
1022 | $sql = 'SHOW server_version'; |
|
1023 | } |
|
1024 | ||
1025 | $version = $em->createNativeQuery($sql, $rsm) |
|
1026 | ->getSingleScalarResult(); |