forked from silverstripe/silverstripe-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_register_database.php
33 lines (30 loc) · 1.23 KB
/
_register_database.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
// Register the SilverStripe provided databases
$frameworkPath = defined('FRAMEWORK_PATH') ? FRAMEWORK_PATH : FRAMEWORK_NAME;
// Use MySQLi as default
DatabaseAdapterRegistry::register(
array(
/** @skipUpgrade */
'class' => 'MySQLDatabase',
'title' => 'MySQL 5.0+ (using MySQLi)',
'helperPath' => $frameworkPath . '/dev/install/MySQLDatabaseConfigurationHelper.php',
'supported' => class_exists('MySQLi'),
'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.'
)
);
// Setup MySQL PDO as alternate option
DatabaseAdapterRegistry::register(
array(
/** @skipUpgrade */
'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.'
)
);