Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ENHANCEMENT Added _register_database.php to sapphire which sets the S…

…S provided databases for DatabaseAdapterRegistry (from r100902)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111537 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 726adb6205d9f74ffa45c4de6a51160e662eb57f 1 parent 1c6e0c3
@sminnee sminnee authored
Showing with 41 additions and 0 deletions.
  1. +41 −0 _register_database.php
View
41 _register_database.php
@@ -0,0 +1,41 @@
+<?php
+
+// Register the SilverStripe provided databases
+DatabaseAdapterRegistry::register(
+ array(
+ 'class' => '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 <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.'
+ )
+);
+
+DatabaseAdapterRegistry::register(
+ array(
+ 'class' => 'PostgreSQLDatabase',
+ 'title' => 'PostgreSQL 8.3+',
+ 'helperPath' => 'postgresql/code/PostgreSQLDatabaseConfigurationHelper.php',
+ 'supported' => function_exists('pg_query'),
+ 'missingExtensionText' => 'The <a href="http://php.net/pgsql">pgsql</a> 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 <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 them and refresh this page.'
+ )
+);
Please sign in to comment.
Something went wrong with that request. Please try again.