Skip to content

Commit a0c575b

Browse files
authored
Merge pull request #1 from yiisoft/master
update master
2 parents 837c14c + 4b425fd commit a0c575b

File tree

8 files changed

+66
-99
lines changed

8 files changed

+66
-99
lines changed

.github/workflows/build.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: build
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi"
7+
8+
jobs:
9+
phpunit:
10+
name: PHP ${{ matrix.php }} on ${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
services:
13+
mongodb:
14+
image: mongo:${{ matrix.mongo }}
15+
ports:
16+
- 27017:27017
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest]
21+
php: ['7.0', '7.1', '7.2', '7.3', '7.4']
22+
mongo: ['3']
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
- name: Install PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php }}
31+
tools: pecl
32+
extensions: mongodb
33+
ini-values: date.timezone='UTC'
34+
- name: Get composer cache directory
35+
id: composer-cache
36+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
37+
- name: Cache composer dependencies
38+
uses: actions/cache@v1
39+
with:
40+
path: ${{ steps.composer-cache.outputs.dir }}
41+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
42+
restore-keys: ${{ runner.os }}-composer-
43+
- name: Install dependencies
44+
run: composer update $DEFAULT_COMPOSER_FLAGS
45+
- name: PHP Unit tests for PHP 7.1
46+
run: vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --colors=always
47+
if: matrix.php == '7.1'
48+
- name: PHP Unit tests for PHP >= 7.2
49+
run: vendor/bin/phpunit --verbose --colors=always
50+
if: matrix.php >= '7.2'
51+
- name: PHP Unit tests for PHP <= 7.0
52+
run: vendor/bin/phpunit --verbose --colors=always
53+
if: matrix.php <= '7.0'
54+
- name: Code coverage
55+
run: |
56+
wget https://scrutinizer-ci.com/ocular.phar
57+
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
58+
if: matrix.php == '7.1'
59+
continue-on-error: true # if is fork

.travis.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Yii Framework 2 mongodb extension Change Log
44
2.1.10 under development
55
------------------------
66

7-
- no changes in this release.
7+
- Bug #308: Fix `yii\mongodb\file\Upload::addFile()` error when uploading file with readonly permissions (sparchatus)
88

99

1010
2.1.9 November 19, 2019

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Documentation is at [docs/guide/README.md](docs/guide/README.md).
1414

1515
[![Latest Stable Version](https://poser.pugx.org/yiisoft/yii2-mongodb/v/stable.png)](https://packagist.org/packages/yiisoft/yii2-mongodb)
1616
[![Total Downloads](https://poser.pugx.org/yiisoft/yii2-mongodb/downloads.png)](https://packagist.org/packages/yiisoft/yii2-mongodb)
17-
[![Build Status](https://travis-ci.com/yiisoft/yii2-mongodb.svg?branch=master)](https://travis-ci.com/yiisoft/yii2-mongodb)
17+
[![Build Status](https://github.com/yiisoft/yii2-mongodb/workflows/build/badge.svg)](https://github.com/yiisoft/yii2-mongodb/actions)
1818

1919

2020
Installation
@@ -51,7 +51,7 @@ return [
5151
'components' => [
5252
'mongodb' => [
5353
'class' => '\yii\mongodb\Connection',
54-
'dsn' => 'mongodb://@localhost:27017/mydatabase',
54+
'dsn' => 'mongodb://localhost:27017/mydatabase',
5555
'options' => [
5656
"username" => "Username",
5757
"password" => "Password"

src/file/Upload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function addFile($filename)
178178
$this->filename = basename($filename);
179179
}
180180

181-
$stream = fopen($filename, 'r+');
181+
$stream = fopen($filename, 'r');
182182
if ($stream === false) {
183183
throw new InvalidParamException("Unable to read file '{$filename}'");
184184
}
@@ -277,4 +277,4 @@ private function insertFile()
277277
$this->collection->insert($fileDocument);
278278
return $fileDocument;
279279
}
280-
}
280+
}

tests/data/config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
$config = [
99
'mongodb' => [
10-
'dsn' => 'mongodb://travis:test@localhost:27017/yii2test',
10+
'dsn' => 'mongodb://localhost:27017/yii2test',
1111
'options' => [],
1212
'driverOptions' => [],
1313
]
@@ -17,4 +17,4 @@
1717
include(__DIR__ . '/config.local.php');
1818
}
1919

20-
return $config;
20+
return $config;

tests/data/travis/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/data/travis/mongodb-setup.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)