Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dg/dibi
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c3b365e59986662633219708e5f0e5a894c5925d
Choose a base ref
..
head repository: dg/dibi
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a2577e34bb1d31ceb039c39ba91f8c1fee02be74
Choose a head ref
Showing with 10 additions and 121 deletions.
  1. +0 −74 .travis.yml
  2. +1 −1 readme.md
  3. +8 −7 src/Dibi/Drivers/SqlsrvDriver.php
  4. +1 −1 tests/.coveralls.yml
  5. +0 −38 tests/databases.travis.ini
74 changes: 0 additions & 74 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
=========================================================

[![Downloads this Month](https://img.shields.io/packagist/dm/dibi/dibi.svg)](https://packagist.org/packages/dibi/dibi)
[![Build Status](https://travis-ci.org/dg/dibi.svg?branch=master)](https://travis-ci.org/dg/dibi)
[![Tests](https://github.com/dg/dibi/workflows/Tests/badge.svg?branch=master)](https://github.com/dg/dibi/actions)
[![Build Status Windows](https://ci.appveyor.com/api/projects/status/github/dg/dibi?branch=master&svg=true)](https://ci.appveyor.com/project/dg/dibi/branch/master)
[![Latest Stable Version](https://poser.pugx.org/dibi/dibi/v/stable)](https://github.com/dg/dibi/releases)
[![License](https://img.shields.io/badge/license-New%20BSD-blue.svg)](https://github.com/dg/dibi/blob/master/license.md)
15 changes: 8 additions & 7 deletions src/Dibi/Drivers/SqlsrvDriver.php
Original file line number Diff line number Diff line change
@@ -51,6 +51,9 @@ public function __construct(array $config)

if (isset($config['resource'])) {
$this->connection = $config['resource'];
if (!is_resource($this->connection)) {
throw new \InvalidArgumentException("Configuration option 'resource' is not resource.");
}

} else {
$options = $config['options'];
@@ -63,15 +66,13 @@ public function __construct(array $config)

sqlsrv_configure('WarningsReturnAsErrors', 0);
$this->connection = sqlsrv_connect($config['host'], $options);
}

if (!is_resource($this->connection)) {
$info = sqlsrv_errors(SQLSRV_ERR_ERRORS);
throw new Dibi\DriverException($info[0]['message'], $info[0]['code']);
}
if (!isset($config['resource'])) {
if (!is_resource($this->connection)) {
$info = sqlsrv_errors(SQLSRV_ERR_ERRORS);
throw new Dibi\DriverException($info[0]['message'], $info[0]['code']);
}
sqlsrv_configure('WarningsReturnAsErrors', 1);
}

$this->version = sqlsrv_server_info($this->connection)['SQLServerVersion'];
}

2 changes: 1 addition & 1 deletion tests/.coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# for php-coveralls
service_name: travis-ci
service_name: github-actions
coverage_clover: coverage.xml
json_path: coverage.json
38 changes: 0 additions & 38 deletions tests/databases.travis.ini

This file was deleted.