Merge pull request #47 from NightJar/twowards-ss4-support

WIP: Stable SilverStripe 4 Support
This commit is contained in:
Daniel Hensby 2018-01-19 15:38:56 +00:00 committed by GitHub
commit 406fcee3cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View File

@ -1,7 +1,7 @@
---
name: mssqlconnectors
---
Injector:
SilverStripe\Core\Injector\Injector:
# Connect using PDO
MSSQLPDODatabase:
class: 'SilverStripe\MSSQL\MSSQLDatabase'

View File

@ -2,7 +2,8 @@
namespace SilverStripe\MSSQL;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Core\ClassInfo;
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\Connect\Database;
@ -51,6 +52,8 @@ use SilverStripe\ORM\Queries\SQLSelect;
*/
class MSSQLDatabase extends Database
{
use Configurable;
use Injectable;
/**
* Words that will trigger an error if passed to a SQL Server fulltext search
@ -83,7 +86,7 @@ class MSSQLDatabase extends Database
*/
public static function set_collation($collation)
{
Config::inst()->update('SilverStripe\\MSSQL\\MSSQLDatabase', 'collation', $collation);
static::config()->set('collation', $collation);
}
/**
@ -95,7 +98,7 @@ class MSSQLDatabase extends Database
*/
public static function get_collation()
{
return Config::inst()->get('SilverStripe\\MSSQL\\MSSQLDatabase', 'collation');
return static::config()->get('collation');
}
/**

View File

@ -1,7 +1,7 @@
{
"name": "silverstripe/mssql",
"description": "Adds MSSQL support to SilverStripe",
"type": "silverstripe-module",
"type": "silverstripe-vendormodule",
"keywords": ["silverstripe", "mssql", "database"],
"authors": [
{
@ -16,6 +16,10 @@
"require": {
"silverstripe/framework": "^4"
},
"suggest": {
"ext-sqlsrv": "Required to support MSSQLDatabase as the server type",
"ext-pdo_sqlsrv": "Required to support MSSQLPDODatabase as the server type"
},
"extra": {
"branch-alias": {
"dev-master": "2.x-dev"