2013-04-03 06:19:26 +02:00
|
|
|
<?php
|
|
|
|
|
2016-08-30 03:08:11 +02:00
|
|
|
use SilverStripe\Dev\Install\DatabaseAdapterRegistry;
|
2016-08-16 08:09:48 +02:00
|
|
|
use SilverStripe\MSSQL\MSSQLDatabaseConfigurationHelper;
|
|
|
|
|
2016-08-30 03:08:11 +02:00
|
|
|
// PDO connector for MS SQL Server
|
|
|
|
/** @skipUpgrade */
|
2013-04-03 06:19:26 +02:00
|
|
|
DatabaseAdapterRegistry::register(array(
|
|
|
|
'class' => 'MSSQLPDODatabase',
|
|
|
|
'title' => 'SQL Server 2008 (using PDO)',
|
|
|
|
'helperPath' => dirname(__FILE__).'/code/MSSQLDatabaseConfigurationHelper.php',
|
2016-08-16 08:09:48 +02:00
|
|
|
'supported' => !!MSSQLDatabaseConfigurationHelper::getPDODriver(),
|
2013-04-03 06:19:26 +02:00
|
|
|
'missingExtensionText' =>
|
|
|
|
'Either the <a href="http://www.php.net/manual/en/book.pdo.php">PDO Extension</a> or
|
|
|
|
the <a href="http://www.php.net/manual/en/ref.pdo-sqlsrv.php">SQL Server PDO Driver</a>
|
|
|
|
are unavailable. Please install or enable these and refresh this page.'
|
|
|
|
));
|
|
|
|
|
|
|
|
// Basic driver using sqlsrv connector
|
2016-07-15 03:57:54 +02:00
|
|
|
/** @skipUpgrade */
|
2013-04-03 06:19:26 +02:00
|
|
|
DatabaseAdapterRegistry::register(array(
|
|
|
|
'class' => 'MSSQLDatabase',
|
|
|
|
'title' => 'SQL Server 2008 (using sqlsrv)',
|
|
|
|
'helperPath' => dirname(__FILE__).'/code/MSSQLDatabaseConfigurationHelper.php',
|
|
|
|
'supported' => function_exists('sqlsrv_connect'),
|
|
|
|
'missingExtensionText' =>
|
|
|
|
'The <a href="http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx">sqlsrv</a>
|
|
|
|
PHP extensions is not available. Please install or enable it and refresh this page.',
|
|
|
|
'fields' => array_merge(DatabaseAdapterRegistry::get_default_fields(), array(
|
|
|
|
// @todo - do we care about windows authentication for PDO/SQL Server?
|
|
|
|
'windowsauthentication' => array(
|
|
|
|
'title' => 'Use Windows authentication? (leave blank for false)',
|
|
|
|
'default' => ''
|
|
|
|
)
|
|
|
|
))
|
|
|
|
));
|
|
|
|
|
|
|
|
// MS Azure uses an online database
|
2016-07-15 03:57:54 +02:00
|
|
|
/** @skipUpgrade */
|
2013-04-03 06:19:26 +02:00
|
|
|
DatabaseAdapterRegistry::register(array(
|
|
|
|
'class' => 'MSSQLAzureDatabase',
|
|
|
|
'title' => 'MS Azure Database (using sqlsrv)',
|
|
|
|
'helperPath' => dirname(__FILE__).'/code/MSSQLDatabaseConfigurationHelper.php',
|
|
|
|
'supported' => function_exists('sqlsrv_connect'),
|
|
|
|
'missingExtensionText' =>
|
|
|
|
'The <a href="http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx">sqlsrv</a>
|
|
|
|
PHP extension is not available. Please install or enable it and refresh this page.'
|
|
|
|
));
|