Skip to content

Commit

Permalink
feat: Separate code
Browse files Browse the repository at this point in the history
  • Loading branch information
alphasnow committed Mar 10, 2022
1 parent dc4af7c commit 7bb9d60
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 281 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ jobs:
- name: PHPCSFixer check
run: composer check-style

# phpstan:
# runs-on: ubuntu-18.04
# steps:
# - uses: actions/checkout@v2
#
# - name: Setup PHP environment
# uses: shivammathur/setup-php@v2
# with:
# php-version: '8.0'
#
# - name: Install dependencies
# run: composer install --prefer-dist --no-progress
#
# - name: PHP Static Analysis
# run: composer phpstan
phpstan:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2

- name: Setup PHP environment
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'

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

- name: PHP Static Analysis
run: composer phpstan

phpunit:
strategy:
Expand Down
26 changes: 13 additions & 13 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
filter:
excluded_paths:
- 'tests/*'
checks:
php: true
coding_style:
php: { }

build:
environment:
php:
version: 8.0
tests:
override:
-
command: 'vendor/bin/phpunit --coverage-clover=some-file'
coverage:
file: 'some-file'
format: 'clover'
version: '8.0.2'
variables:
XDEBUG_MODE: coverage
nodes:
analysis:
tests:
override:
- php-scrutinizer-run

tools:
external_code_coverage:
timeout: 600
2 changes: 0 additions & 2 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Laravel 的阿里云对象存储 Storage 扩展
'use_ssl' => env('OSS_SSL', false), // Optional, 是否使用HTTPS
'prefix' => env('OSS_PREFIX', ''), // Optional, 统一存储地址前缀
"reverse_proxy' => env('OSS_REVERSE_PROXY', false), // Optional, 域名是否使用NGINX代理绑定
'signature_expires' => env('OSS_SIGNATURE_EXPIRES', 3600), // Optional, 临时域名的默认过期时间, 单位秒
],
// ...
]
Expand Down Expand Up @@ -81,7 +80,6 @@ Storage::disk('oss')->put('dir/path/download.txt', 'Download content', ["headers
#### 读取
```php
Storage::disk('oss')->url('dir/path/file.txt');
Storage::disk('oss')->temporaryUrl('dir/path/file.txt');
Storage::disk('oss')->temporaryUrl('dir/path/file.txt', \Carbon\Carbon::now()->addMinutes(30));

Storage::disk('oss')->get('dir/path/file.txt');
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ This package is a wrapper bridging [aliyun-oss-flysystem](https://github.com/alp
'use_ssl' => env('OSS_SSL', false), // Optional, Whether to use HTTPS
'prefix' => env('OSS_PREFIX', ''), // Optional, The prefix of the store path
"reverse_proxy' => env('OSS_REVERSE_PROXY', false), // Optional, Nginx reverse proxy domain
'signature_expires' => env('OSS_SIGNATURE_EXPIRES', 3600), // Optional, Default expiration time for temporary url
],
// ...
]
Expand Down Expand Up @@ -81,7 +80,6 @@ Storage::disk('oss')->put('dir/path/download.txt', 'Download content', ["headers
#### Read
```php
Storage::disk('oss')->url('dir/path/file.txt');
Storage::disk('oss')->temporaryUrl('dir/path/file.txt');
Storage::disk('oss')->temporaryUrl('dir/path/file.txt', \Carbon\Carbon::now()->addMinutes(30));
Storage::disk('oss')->get('dir/path/file.txt');
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"require": {
"php": "^8.0.2",
"alphasnow/aliyun-oss-flysystem": "^3.0"
"alphasnow/aliyun-oss-flysystem": "^3.2"
},
"require-dev": {
"mockery/mockery": "^1.5",
Expand Down
4 changes: 2 additions & 2 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"options" => [
// \OSS\OssClient::OSS_CHECK_MD5 => false,
],
"reverse_proxy" => env('OSS_REVERSE_PROXY', false),
'signature_expires' => env('OSS_SIGNATURE_EXPIRES', 3600),
'internal' => env('OSS_INTERNAL', null), // For example: oss-cn-shanghai-internal.aliyuncs.com
'domain' => env('OSS_DOMAIN', null), // For example: oss.my-domain.com
"reverse_proxy" => env('OSS_REVERSE_PROXY', false),

'macros' => []
];
56 changes: 24 additions & 32 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Application Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
<exclude>
<directory suffix="ServiceProvider.php">src/</directory>
<directory suffix="Exception.php">src/</directory>
</exclude>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="OSS_ACCESS_KEY_ID" value="access_id" />
<env name="OSS_ACCESS_KEY_SECRET" value="access_secret" />
<env name="OSS_BUCKET" value="bucket" />
<env name="OSS_ENDPOINT" value="endpoint.com" />
<env name="OSS_PREFIX" value="tests" />
</php>
</phpunit>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">./src/</directory>
</include>
<exclude>
<directory suffix="ServiceProvider.php">./src/</directory>
<directory suffix=".php">./macros/</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Tests">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="OSS_ACCESS_KEY_ID" value="access_id" />
<env name="OSS_ACCESS_KEY_SECRET" value="access_secret" />
<env name="OSS_BUCKET" value="bucket" />
<env name="OSS_ENDPOINT" value="endpoint.com" />
<env name="OSS_PREFIX" value="tests" />
</php>
</phpunit>
101 changes: 0 additions & 101 deletions src/AliyunAdapter.php

This file was deleted.

77 changes: 0 additions & 77 deletions src/AliyunConfig.php

This file was deleted.

Loading

0 comments on commit 7bb9d60

Please sign in to comment.