Skip to content

Commit

Permalink
Merge pull request #25 from drupol/refactor/upgrade-to-flysystem-2
Browse files Browse the repository at this point in the history
Upgrade to `league/flysystem` ^2
  • Loading branch information
mzur authored Feb 17, 2022
2 parents 7845f3b + 85ab8b3 commit d75e063
Show file tree
Hide file tree
Showing 12 changed files with 560 additions and 483 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# PHP PSR-2 Coding Standards
# http://www.php-fig.org/psr/psr-2/

root = true

[*.{php,inc,module}]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[*.{json,json.dist,yml,yml.dist}]
indent_size = 4
45 changes: 45 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on:
push:
branches:
- master
pull_request:

name: "Static analysis"

jobs:
run:
name: "Static Analysis"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ["7.4", "8.0", "8.1"]

steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 1

- name: Install PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-versions }}

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/[email protected]
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Send feedback on Github
run: vendor/bin/psalm --output-format=github
34 changes: 0 additions & 34 deletions .github/workflows/test.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

on:
push:
branches:
- master
pull_request:

name: "Unit tests"

jobs:
run:
name: "Unit Tests"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ["7.4", "8.0", "8.1"]

steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 1

- name: Install PHP
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-versions }}
extensions: gd,mbstring,pcov,xdebug

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/[email protected]
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run PHPUnit
run: vendor/bin/phpunit
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
vendor/
composer.lock
/composer.lock
/vendor
.phpunit.result.cache
33 changes: 0 additions & 33 deletions .scrutinizer.yml

This file was deleted.

27 changes: 13 additions & 14 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
MIT License
The MIT License (MIT)

Copyright (c) Chris Harvey
Copyright (c) 2016 Chris Harvey

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $flysystem = new League\Flysystem\Filesystem($adapter);

## Configuration

The Swift adapter allows you to configure the behavior of uploading [large objects](https://php-opencloudopenstack.readthedocs.io/en/latest/services/object-store/v1/objects.html#create-a-large-object-over-5gb). You can set the following configuration options:
The Swift adapter allows you to configure the behavior of uploading [large objects](https://php-opencloudopenstack.readthedocs.io/en/latest/services/object-store/v1/objects.html#create-a-large-object-over-5gb) with `writeStream()`. You can set the following configuration options:

- `swiftLargeObjectThreshold`: Size of the file in bytes when to switch over to the large object upload procedure. Default is 300 MiB. The maximum allowed size of regular objects is 5 GiB.
- `swiftSegmentSize`: Size of individual segments or chunks that the large file is split up into. Default is 100 MiB. Should be below 5 GiB.
Expand Down
32 changes: 20 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@
"name": "nimbusoft/flysystem-openstack-swift",
"description": "Flysystem adapter for OpenStack Swift",
"keywords": [
"filesystem", "filesystems", "files", "chrisnharvey",
"storage", "flysystem", "openstack", "opencloud", "swift"
"filesystem",
"filesystems",
"files",
"chrisnharvey",
"storage",
"flysystem",
"openstack",
"opencloud",
"swift"
],
"license": "MIT",
"authors": [
Expand All @@ -12,19 +19,20 @@
"email": "[email protected]"
}
],
"require": {
"php": ">= 7.4",
"league/flysystem": "^2.0",
"php-opencloud/openstack": "^3.2",
"guzzlehttp/psr7": "^2.0"
},
"require-dev": {
"mockery/mockery": ">= 1.3.1",
"phpunit/phpunit": ">= 5.5",
"vimeo/psalm": "^4.20"
},
"autoload": {
"psr-4": {
"Nimbusoft\\Flysystem\\OpenStack\\": "src/"
}
},
"require": {
"php": ">=7.3",
"php-opencloud/openstack": "^3.0 | ^3.2",
"league/flysystem": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"mockery/mockery": "^1.3.1",
"mikey179/vfsstream": "^1.6.4"
}
}
15 changes: 15 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<psalm
errorLevel="7"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
Loading

0 comments on commit d75e063

Please sign in to comment.