MediaWiki REL1_35
DoctrineSchemaBuilderFactory.php
Go to the documentation of this file.
1<?php
2
3namespace Wikimedia\Rdbms;
4
5use Doctrine\DBAL\Platforms\MySQLPlatform;
6use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
7use Doctrine\DBAL\Platforms\SqlitePlatform;
8use InvalidArgumentException;
9
15
20 public function getSchemaBuilder( $platform ) {
21 if ( $platform === 'mysql' ) {
22 $platformObject = new MySQLPlatform();
23 } elseif ( $platform === 'postgres' ) {
24 $platformObject = new PostgreSQL94Platform();
25 } elseif ( $platform === 'sqlite' ) {
26 $platformObject = new SqlitePlatform();
27 } else {
28 throw new InvalidArgumentException( 'Unknown platform: ' . $platform );
29 }
30
31 return new DoctrineSchemaBuilder( $platformObject );
32 }
33}