2010-10-04 06:16:29 +02:00
|
|
|
<?php
|
|
|
|
|
2016-11-02 06:07:18 +01:00
|
|
|
// Register database adapters available in SilverStripe
|
2016-08-19 00:51:35 +02:00
|
|
|
use SilverStripe\Dev\Install\DatabaseAdapterRegistry;
|
2016-10-11 02:16:27 +02:00
|
|
|
use SilverStripe\Dev\Install\MySQLDatabaseConfigurationHelper;
|
2012-04-14 03:26:59 +02:00
|
|
|
|
2010-10-04 06:16:29 +02:00
|
|
|
|
2016-11-02 06:07:18 +01:00
|
|
|
// Register MySQL PDO as a database adapter (listed as first option in Dev/Install/config-form.html)
|
2010-10-04 06:16:29 +02:00
|
|
|
DatabaseAdapterRegistry::register(
|
|
|
|
array(
|
2016-07-04 06:32:45 +02:00
|
|
|
/** @skipUpgrade */
|
2013-06-21 00:32:08 +02:00
|
|
|
'class' => 'MySQLPDODatabase',
|
2016-10-11 02:16:27 +02:00
|
|
|
'module' => 'framework',
|
2013-06-21 00:32:08 +02:00
|
|
|
'title' => 'MySQL 5.0+ (using PDO)',
|
2016-11-01 04:13:06 +01:00
|
|
|
'helperPath' => __DIR__ . '/src/Dev/Install/MySQLDatabaseConfigurationHelper.php',
|
2016-10-11 02:16:27 +02:00
|
|
|
'helperClass' => MySQLDatabaseConfigurationHelper::class,
|
2013-06-21 00:32:08 +02:00
|
|
|
'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
|
|
|
);
|
2016-11-02 06:07:18 +01:00
|
|
|
|
|
|
|
// Register MySQLi as a database adapter (listed as second option in Dev/Install/config-form.html)
|
|
|
|
DatabaseAdapterRegistry::register(
|
|
|
|
array(
|
|
|
|
/** @skipUpgrade */
|
|
|
|
'class' => 'MySQLDatabase',
|
|
|
|
'module' => 'framework',
|
|
|
|
'title' => 'MySQL 5.0+ (using MySQLi)',
|
|
|
|
'helperPath' => __DIR__ . '/src/Dev/Install/MySQLDatabaseConfigurationHelper.php',
|
|
|
|
'helperClass' => MySQLDatabaseConfigurationHelper::class,
|
|
|
|
'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.'
|
|
|
|
)
|
|
|
|
);
|