MSSQL Server Extension for Yii 3
This extension provides the MSSQL Server support for the Yii framework 3 .
Support version
| PHP | Mssql Version | CI-Actions |
|---|---|---|
| 7.4 - 8.0 | 2017 - 2019 |
Installation
The package could be installed via composer:
composer require yiisoft/db-mssqlConfiguration
Using yiisoft/composer-config-plugin automatically get the settings of CacheInterface::class, LoggerInterface::class, and Profiler::class.
Di-Container:
use Psr\Log\LoggerInterface;
use Yiisoft\Cache\CacheInterface;
use Yiisoft\Db\Mssql\Connection as MssqlConnection;
use Yiisoft\Factory\Definitions\Reference;
use Yiisoft\Profiler\Profiler;
return [
MssqlConnection::class => [
'__class' => MssqlConnection::class,
'__construct()' => [
Reference::to(CacheInterface::class),
Reference::to(LoggerInterface::class),
Reference::to(Profiler::class),
$params['yiisoft/db-mssql']['dsn']
],
'setUsername()' => [$params['yiisoft/db-mssql']['username']],
'setPassword()' => [$params['yiisoft/db-mssql']['password']]
]
];Params.php
use Yiisoft\Db\Mssql\Dsn as MssqlDsn;
return [
'yiisoft/db-mssql' => [
'dsn' => (new MssqlDsn('sqlsrv', '127.0.0.1', 'yiitest', '1433'))->getDsn(),
'username' => 'SA',
'password' => 'YourStrong!Passw0rd'
]
];Unit testing
The package is tested with PHPUnit. To run tests:
./vendor/bin/phpunitNote: You must have MSSQL installed to run the tests, it supports all MSSQL versions.
Mutation testing
The package tests are checked with Infection mutation framework. To run it:
./vendor/bin/infectionStatic analysis
The code is statically analyzed with Psalm. To run static analysis:
./vendor/bin/psalm

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.




