Fix class loading issues

This commit is contained in:
Dylan Wagstaff 2018-01-19 16:27:18 +13:00
parent 2b6a70e529
commit 76fb2b29dc
3 changed files with 12 additions and 5 deletions

View File

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

View File

@ -2,7 +2,8 @@
namespace SilverStripe\MSSQL; namespace SilverStripe\MSSQL;
use SilverStripe\Core\Config\Config; use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Core\ClassInfo; use SilverStripe\Core\ClassInfo;
use SilverStripe\ORM\ArrayList; use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\Connect\Database; use SilverStripe\ORM\Connect\Database;
@ -51,6 +52,8 @@ use SilverStripe\ORM\Queries\SQLSelect;
*/ */
class MSSQLDatabase extends Database class MSSQLDatabase extends Database
{ {
use Configurable;
use Injectable;
/** /**
* Words that will trigger an error if passed to a SQL Server fulltext search * 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) 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() 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", "name": "silverstripe/mssql",
"description": "Adds MSSQL support to SilverStripe", "description": "Adds MSSQL support to SilverStripe",
"type": "silverstripe-module", "type": "silverstripe-vendormodule",
"keywords": ["silverstripe", "mssql", "database"], "keywords": ["silverstripe", "mssql", "database"],
"authors": [ "authors": [
{ {
@ -16,6 +16,10 @@
"require": { "require": {
"silverstripe/framework": "^4" "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": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.x-dev" "dev-master": "2.x-dev"