terabytesoft / db-mssql
MSSQL Server extension for the Yii framework
This package's canonical repository appears to be gone and the package has been frozen as a result.
Fund package maintenance!
Open Collective
yiisoft
Requires
- php: ^8.0
- ext-pdo: *
- terabytesoft/db: @dev
- yiisoft/arrays: ^2.0
Requires (Dev)
- phpunit/phpunit: ^9.4
- roave/infection-static-analysis-plugin: ^1.6
- vimeo/psalm: ^4.2
- yiisoft/aliases: ^1.1|^2.0
- yiisoft/cache: ^1.0
- yiisoft/log: ^1.0
This package is auto-updated.
Last update: 2023-05-08 01:31:32 UTC
README
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-mssql
Configuration
Using yiisoft/composer-config-plugin automatically get the settings of Yiisoft\Cache\CacheInterface::class
, LoggerInterface::class
, and Profiler::class
.
Di-Container:
use Yiisoft\Db\Connection\ConnectionInterface; use Yiisoft\Db\Mssql\Connection as MssqlConnection; return [ ConnectionInterface::class => [ 'class' => MssqlConnection::class, '__construct()' => [ 'dsn' => $params['yiisoft/db-mssql']['dsn'] ], 'setUsername()' => [$params['yiisoft/db-mssql']['username']], 'setPassword()' => [$params['yiisoft/db-mssql']['password']], ] ];
Params.php
use Yiisoft\Db\Mssql\Dsn; return [ 'yiisoft/db-mssql' => [ 'dsn' => (new Dsn('sqlsrv', '127.0.0.1', 'yiitest', '1433'))->asString(), 'username' => 'SA', 'password' => 'YourStrong!Passw0rd', ] ];
Unit testing
The package is tested with PHPUnit. To run tests:
./vendor/bin/phpunit
Mutation testing
The package tests are checked with Infection mutation framework. To run it:
./vendor/bin/infection
Static analysis
The code is statically analyzed with Psalm. To run static analysis:
./vendor/bin/psalm
Support the project
Follow updates
License
The MSSQL Server Extension for Yii 3 is free software. It is released under the terms of the BSD License.
Please see LICENSE
for more information.
Maintained by Yii Software.