2010-10-04 06:16:29 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Register the SilverStripe provided databases
|
2012-04-14 03:26:59 +02:00
|
|
|
$frameworkPath = defined('FRAMEWORK_PATH') ? FRAMEWORK_PATH : FRAMEWORK_NAME;
|
|
|
|
|
2013-06-21 00:32:08 +02:00
|
|
|
// Use MySQLi as default
|
2010-10-04 06:16:29 +02:00
|
|
|
DatabaseAdapterRegistry::register(
|
|
|
|
array(
|
|
|
|
'class' => 'MySQLDatabase',
|
2013-06-21 00:32:08 +02:00
|
|
|
'title' => 'MySQL 5.0+ (using MySQLi)',
|
2012-04-14 03:26:59 +02:00
|
|
|
'helperPath' => $frameworkPath . '/dev/install/MySQLDatabaseConfigurationHelper.php',
|
2012-04-28 02:13:58 +02:00
|
|
|
'supported' => class_exists('MySQLi'),
|
2013-06-21 00:32:08 +02:00
|
|
|
'missingExtensionText' =>
|
|
|
|
'The <a href="http://www.php.net/manual/en/book.mysqli.php">MySQLi</a>
|
|
|
|
PHP extension is not available. Please install or enable it and refresh this page.'
|
2010-10-04 06:16:29 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2013-06-21 00:32:08 +02:00
|
|
|
// Setup MySQL PDO as alternate option
|
2010-10-04 06:16:29 +02:00
|
|
|
DatabaseAdapterRegistry::register(
|
|
|
|
array(
|
2013-06-21 00:32:08 +02:00
|
|
|
'class' => 'MySQLPDODatabase',
|
|
|
|
'title' => 'MySQL 5.0+ (using PDO)',
|
|
|
|
'helperPath' => $frameworkPath . '/dev/install/MySQLDatabaseConfigurationHelper.php',
|
|
|
|
'supported' => (class_exists('PDO') && in_array('mysql', PDO::getAvailableDrivers())),
|
|
|
|
'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-mysql.php">MySQL PDO Driver</a>
|
|
|
|
are unavailable. Please install or enable these and refresh this page.'
|
2010-10-04 06:16:29 +02:00
|
|
|
)
|
2014-08-15 08:53:05 +02:00
|
|
|
);
|