From 726adb6205d9f74ffa45c4de6a51160e662eb57f Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Mon, 4 Oct 2010 04:16:29 +0000 Subject: [PATCH] ENHANCEMENT Added _register_database.php to sapphire which sets the SS provided databases for DatabaseAdapterRegistry (from r100902) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111537 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- _register_database.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 _register_database.php diff --git a/_register_database.php b/_register_database.php new file mode 100644 index 000000000..04718d053 --- /dev/null +++ b/_register_database.php @@ -0,0 +1,41 @@ + 'MySQLDatabase', + 'title' => 'MySQL 4.1+', + 'helperPath' => 'sapphire/dev/install/MySQLDatabaseConfigurationHelper.php', + 'supported' => function_exists('mysql_connect') + ) +); + +DatabaseAdapterRegistry::register( + array( + 'class' => 'MSSQLDatabase', + 'title' => 'SQL Server 2008', + 'helperPath' => 'mssql/code/MSSQLDatabaseConfigurationHelper.php', + 'supported' => (function_exists('mssql_connect') || function_exists('sqlsrv_connect')), + 'missingExtensionText' => 'Neither the mssql or sqlsrv PHP extensions are available. Please install or enable one of them and refresh this page.' + ) +); + +DatabaseAdapterRegistry::register( + array( + 'class' => 'PostgreSQLDatabase', + 'title' => 'PostgreSQL 8.3+', + 'helperPath' => 'postgresql/code/PostgreSQLDatabaseConfigurationHelper.php', + 'supported' => function_exists('pg_query'), + 'missingExtensionText' => 'The pgsql PHP extension is not available. Please install or enable it and refresh this page.' + ) +); + +DatabaseAdapterRegistry::register( + array( + 'class' => 'SQLite3Database', + 'title' => 'SQLite 3.3+', + 'helperPath' => 'sqlite3/code/SQLiteDatabaseConfigurationHelper.php', + 'supported' => (class_exists('SQLite3') || class_exists('PDO')), + 'missingExtensionText' => 'The SQLite3 and PDO classes are not available. Please install or enable them and refresh this page.' + ) +);