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;
|
|
|
|
|
2010-10-04 06:16:29 +02:00
|
|
|
DatabaseAdapterRegistry::register(
|
|
|
|
array(
|
|
|
|
'class' => 'MySQLDatabase',
|
2010-10-15 03:05:06 +02:00
|
|
|
'title' => 'MySQL 5.0+',
|
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'),
|
2010-10-04 06:16:29 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DatabaseAdapterRegistry::register(
|
|
|
|
array(
|
|
|
|
'class' => 'MSSQLDatabase',
|
|
|
|
'title' => 'SQL Server 2008',
|
|
|
|
'helperPath' => 'mssql/code/MSSQLDatabaseConfigurationHelper.php',
|
|
|
|
'supported' => (function_exists('mssql_connect') || function_exists('sqlsrv_connect')),
|
2012-09-26 23:34:00 +02:00
|
|
|
'missingExtensionText' => 'Neither the <a href="http://php.net/mssql">mssql</a> or'
|
|
|
|
. ' <a href="http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx">sqlsrv</a> PHP extensions are'
|
|
|
|
. ' available. Please install or enable one of them and refresh this page.'
|
2010-10-04 06:16:29 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DatabaseAdapterRegistry::register(
|
|
|
|
array(
|
|
|
|
'class' => 'PostgreSQLDatabase',
|
|
|
|
'title' => 'PostgreSQL 8.3+',
|
|
|
|
'helperPath' => 'postgresql/code/PostgreSQLDatabaseConfigurationHelper.php',
|
|
|
|
'supported' => function_exists('pg_query'),
|
2012-09-26 23:34:00 +02:00
|
|
|
'missingExtensionText' => 'The <a href="http://php.net/pgsql">pgsql</a> PHP extension is not available. Please'
|
|
|
|
. ' install or enable it and refresh this page.'
|
2010-10-04 06:16:29 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DatabaseAdapterRegistry::register(
|
|
|
|
array(
|
2010-10-19 03:26:27 +02:00
|
|
|
'class' => 'SQLiteDatabase',
|
2010-10-04 06:16:29 +02:00
|
|
|
'title' => 'SQLite 3.3+',
|
|
|
|
'helperPath' => 'sqlite3/code/SQLiteDatabaseConfigurationHelper.php',
|
|
|
|
'supported' => (class_exists('SQLite3') || class_exists('PDO')),
|
2012-09-26 23:34:00 +02:00
|
|
|
'missingExtensionText' => 'The <a href="http://php.net/manual/en/book.sqlite3.php">SQLite3</a> and'
|
|
|
|
. ' <a href="http://php.net/manual/en/book.pdo.php">PDO</a> classes are not available. Please install or'
|
|
|
|
. ' enable one of them and refresh this page.',
|
2010-10-04 06:43:12 +02:00
|
|
|
'fields' => array(
|
|
|
|
'path' => array(
|
2012-09-26 23:34:00 +02:00
|
|
|
'title' => 'Database path<br /><small>Absolute path, writeable by the webserver user.<br />'
|
|
|
|
. 'Recommended to be outside of your webroot</small>',
|
|
|
|
'default' => realpath(dirname($_SERVER['SCRIPT_FILENAME'])) . DIRECTORY_SEPARATOR . 'assets'
|
|
|
|
. DIRECTORY_SEPARATOR . '.db'
|
2010-10-04 06:43:12 +02:00
|
|
|
),
|
|
|
|
'database' => array(
|
|
|
|
'title' => 'Database name',
|
|
|
|
'default' => 'SS_mysite',
|
|
|
|
'attributes' => array(
|
|
|
|
"onchange" => "this.value = this.value.replace(/[\/\\:*?"<>|. \t]+/g,'');"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2010-10-04 06:16:29 +02:00
|
|
|
)
|
|
|
|
);
|