1
<?php
2

3
// Register database adapters available in SilverStripe
4
use SilverStripe\Dev\Install\DatabaseAdapterRegistry;
5
use SilverStripe\Dev\Install\MySQLDatabaseConfigurationHelper;
6

7
// Register MySQLi as a database adapter (listed as second option in Dev/Install/config-form.html)
8 0
DatabaseAdapterRegistry::register(
9
    [
10
        /** @skipUpgrade */
11 0
        'class' => 'MySQLDatabase',
12 0
        'module' => 'framework',
13 0
        'title' => 'MySQL 5.0+ (using MySQLi)',
14 0
        'helperPath' => __DIR__ . '/src/Dev/Install/MySQLDatabaseConfigurationHelper.php',
15 0
        'helperClass' => MySQLDatabaseConfigurationHelper::class,
16 0
        'supported' => class_exists('MySQLi'),
17 0
        'missingExtensionText' =>
18 0
            'The <a href="http://www.php.net/manual/en/book.mysqli.php">MySQLi</a>
19 0
			PHP extension is not available. Please install or enable it and refresh this page.'
20
    ]
21
);
22

23
// Register MySQL PDO as a database adapter (listed as first option in Dev/Install/config-form.html)
24 0
DatabaseAdapterRegistry::register(
25
    [
26
        /** @skipUpgrade */
27 0
        'class' => 'MySQLPDODatabase',
28 0
        'module' => 'framework',
29 0
        'title' => 'MySQL 5.0+ (using PDO) - <b>not recommended</b>',
30 0
        'helperPath' => __DIR__ . '/src/Dev/Install/MySQLDatabaseConfigurationHelper.php',
31 0
        'helperClass' => MySQLDatabaseConfigurationHelper::class,
32 0
        'supported' => (class_exists('PDO') && in_array('mysql', PDO::getAvailableDrivers())),
33 0
        'missingExtensionText' =>
34 0
            'Either the <a href="http://www.php.net/manual/en/book.pdo.php">PDO Extension</a> or
35 0
            the <a href="http://www.php.net/manual/en/ref.pdo-mysql.php">MySQL PDO Driver</a>
36 0
            are unavailable. Please install or enable these and refresh this page.'
37
    ]
38
);

Read our documentation on viewing source code .

Loading