Skip to content

Commit 390b334

Browse files
authored
Merge pull request #103 from skipperbent/v4-development
Version 4.10.0
2 parents e66e7da + d7c0154 commit 390b334

File tree

15 files changed

+376
-155
lines changed

15 files changed

+376
-155
lines changed

.coveralls.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
service_name: travis-ci
2+
coverage_clover: _clover/clover.xml
3+
json_path: _clover/coveralls-upload.json

.travis.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,32 @@ sudo: false
33
language: php
44

55
php:
6-
- 7.1
6+
- 7.2
7+
8+
services:
9+
- mysql
10+
11+
before_install:
12+
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
13+
- mysql test < ./tests/test.sql
714

815
before_script:
9-
- curl -sS http://getcomposer.org/installer | php
10-
- php composer.phar install --prefer-source --no-interaction
16+
- mkdir -p _clover
17+
- ls -al
1118

1219
script:
13-
- ./vendor/bin/phpunit
20+
- ./vendor/bin/phpunit --coverage-clover _clover/clover.xml
21+
22+
install:
23+
# Install composer packages
24+
- travis_retry composer install --no-interaction --no-suggest
25+
# Install coveralls.phar
26+
- wget -c -nc --retry-connrefused --tries=0 https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar -O coveralls.phar
27+
- chmod +x coveralls.phar
28+
- php coveralls.phar --version
29+
30+
after_success:
31+
# Submit coverage report to Coveralls servers, see .coveralls.yml
32+
- travis_retry php coveralls.phar -v
33+
# Submit coverage report to codecov.io
34+
- bash <(curl -s https://codecov.io/bash)

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ The syntax is similar to Laravel's query builder "Eloquent", but with less overh
88
This library is stable, maintained and are used by sites around the world (check the [credits](#credits)).
99

1010
**Requirements:**
11-
- PHP version 7.1 or higher is required for pecee-pixie version 4.x and above. Versions prior to 4.x are available [here](https://github.com/skipperbent/pixie).
11+
- PHP version 7.1 or higher is required for pecee-pixie version 4.x and above (versions prior to 4.x are available [here](https://github.com/skipperbent/pixie)).
12+
- PDO extension.
13+
- PDO sql-lite extension.
1214

1315
**Features:**
1416

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
}
3535
],
3636
"require": {
37-
"php": ">=7.1"
37+
"php": ">=7.1",
38+
"ext-pdo": "*",
39+
"ext-sqlite": "*"
3840
},
3941
"require-dev": {
4042
"phpunit/phpunit": "^6.0",

composer.lock

Lines changed: 48 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Pecee/Pixie/Connection.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ class Connection
2525
*
2626
* @var IConnectionAdapter
2727
*/
28-
protected static $adapter;
28+
protected $adapter;
2929

3030
/**
3131
* @var array
3232
*/
33-
protected static $adapterConfig;
33+
protected $adapterConfig;
3434

3535
/**
3636
* @var \PDO
@@ -74,10 +74,6 @@ public function __construct($adapter, array $adapterConfig)
7474
*/
7575
public static function getStoredConnection(): self
7676
{
77-
if (static::$storedConnection === null && static::$adapter !== null && static::$adapterConfig !== null) {
78-
static::$storedConnection = new static(static::$adapter, static::$adapterConfig);
79-
}
80-
8177
return static::$storedConnection;
8278
}
8379

@@ -102,15 +98,15 @@ public function connect(): self
10298
*/
10399
public function getAdapter(): IConnectionAdapter
104100
{
105-
return static::$adapter;
101+
return $this->adapter;
106102
}
107103

108104
/**
109105
* @return array
110106
*/
111107
public function getAdapterConfig(): array
112108
{
113-
return static::$adapterConfig;
109+
return $this->adapterConfig;
114110
}
115111

116112
/**
@@ -147,7 +143,7 @@ public function getQueryBuilder(): QueryBuilderHandler
147143
*/
148144
public function setAdapter(IConnectionAdapter $adapter): self
149145
{
150-
static::$adapter = $adapter;
146+
$this->adapter = $adapter;
151147

152148
return $this;
153149
}
@@ -159,7 +155,7 @@ public function setAdapter(IConnectionAdapter $adapter): self
159155
*/
160156
public function setAdapterConfig(array $adapterConfig): self
161157
{
162-
static::$adapterConfig = $adapterConfig;
158+
$this->adapterConfig = $adapterConfig;
163159

164160
return $this;
165161
}

0 commit comments

Comments
 (0)