Skip to content

Commit 685bbb4

Browse files
authored
all: rename package (#72)
Closes #68
1 parent b585e5c commit 685bbb4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+306
-310
lines changed

.scrutinizer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build:
1414
coverage:
1515
tests:
1616
override:
17-
- command: ./vendor/bin/phpunit --coverage-clover=coverage.clover
17+
- command: ./vendor/bin/phpunit --coverage-clover=build/coverage.clover
1818
coverage:
19-
file: coverage.clover
19+
file: build/coverage.clover
2020
format: clover

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Laravel Chunk Uploader
1+
# Laravel Upload Handler
22

3-
Chunk Uploader Package For Laravel
3+
Upload Handler Package For Laravel
44

5-
[![Github Actions Badge](https://github.com/coding-socks/laravel-chunk-uploader/workflows/test/badge.svg)](https://github.com/coding-socks/laravel-chunk-uploader/actions?query=workflow%3A"test")
6-
[![Downloads Badge](https://poser.pugx.org/coding-socks/laravel-chunk-uploader/downloads)](https://packagist.org/packages/coding-socks/laravel-chunk-uploader)
7-
[![Version Badge](https://poser.pugx.org/coding-socks/laravel-chunk-uploader/version)](https://packagist.org/packages/coding-socks/laravel-chunk-uploader)
8-
[![Coverage Badge](https://scrutinizer-ci.com/g/coding-socks/laravel-chunk-uploader/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/coding-socks/laravel-chunk-uploader/)
9-
[![License Badge](https://poser.pugx.org/coding-socks/laravel-chunk-uploader/license)](https://packagist.org/packages/coding-socks/laravel-chunk-uploader)
5+
[![Github Actions Badge](https://github.com/coding-socks/laravel-upload-handler/workflows/test/badge.svg)](https://github.com/coding-socks/laravel-upload-handler/actions?query=workflow%3A"test")
6+
[![Downloads Badge](https://poser.pugx.org/coding-socks/laravel-upload-handler/downloads)](https://packagist.org/packages/coding-socks/laravel-upload-handler)
7+
[![Version Badge](https://poser.pugx.org/coding-socks/laravel-upload-handler/version)](https://packagist.org/packages/coding-socks/laravel-upload-handler)
8+
[![Coverage Badge](https://scrutinizer-ci.com/g/coding-socks/laravel-upload-handler/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/coding-socks/laravel-upload-handler/)
9+
[![License Badge](https://poser.pugx.org/coding-socks/laravel-upload-handler/license)](https://packagist.org/packages/coding-socks/laravel-upload-handler)
1010

1111
This package helps integrate a Laravel application with chunk uploader libraries eg.
1212
[DropzoneJS](https://www.dropzonejs.com/) and
@@ -53,7 +53,7 @@ project at the moment is [tus](https://tus.io/).
5353
You can easily install this package using Composer, by running the following command:
5454

5555
```bash
56-
composer require coding-socks/laravel-chunk-uploader
56+
composer require coding-socks/laravel-upload-handler
5757
```
5858

5959
### Requirements
@@ -73,7 +73,7 @@ Route::any('/my-route', 'MyController@myFunction');
7373
- Using dependency injection
7474
```php
7575
use Illuminate\Http\Request;
76-
use CodingSocks\ChunkUploader\UploadHandler;
76+
use CodingSocks\UploadHandler\UploadHandler;
7777

7878
class MyController extends Controller
7979
{
@@ -86,7 +86,7 @@ class MyController extends Controller
8686
- Resolving from the app container
8787
```php
8888
use Illuminate\Http\Request;
89-
use CodingSocks\ChunkUploader\UploadHandler;
89+
use CodingSocks\UploadHandler\UploadHandler;
9090

9191
class MyController extends Controller
9292
{
@@ -110,7 +110,7 @@ library can be differ very much. Also, when possible the library gives the oppor
110110

111111
### Events
112112

113-
Once a file upload is finished a `\CodingSocks\ChunkUploader\Event\FileUploaded` is triggered. This event contains
113+
Once a file upload is finished a `\CodingSocks\UploadHandler\Event\FileUploaded` is triggered. This event contains
114114
the disk and the path of the uploaded file.
115115
[Registering Events & Listeners from Laravel](https://laravel.com/docs/5.8/events#registering-events-and-listeners)
116116

@@ -139,8 +139,8 @@ app()->make(UploadManager::class)->extend('my_driver', function () {
139139
});
140140
```
141141

142-
If you are adding a driver you need to extend the `\CodingSocks\ChunkUploader\Driver\UploadDriver` abstract class, for
143-
which you can use the shipped drivers (e.g. `\CodingSocks\ChunkUploader\Driver\BlueimpUploadDriver`) as an example as to
142+
If you are adding a driver you need to extend the `\CodingSocks\UploadHandler\Driver\UploadDriver` abstract class, for
143+
which you can use the shipped drivers (e.g. `\CodingSocks\UploadHandler\Driver\BlueimpUploadDriver`) as an example as to
144144
how.
145145

146146
If you wrote a custom driver that others might find useful, please consider adding it to the package via a pull request.
@@ -182,7 +182,7 @@ This driver handles requests made by the DropzoneJS client library.
182182

183183
This driver handles requests made by the Flow.js client library.
184184

185-
Because of [Issue #44](https://github.com/coding-socks/laravel-chunk-uploader/issues/44) you must use `forceChunkSize`
185+
Because of [Issue #44](https://github.com/coding-socks/laravel-upload-handler/issues/44) you must use `forceChunkSize`
186186
option.
187187

188188
### ng-file-upload driver
@@ -203,7 +203,7 @@ This driver handles requests made by the Plupload client library.
203203

204204
This driver handles requests made by the Resumable.js client library.
205205

206-
Because of [Issue #44](https://github.com/coding-socks/laravel-chunk-uploader/issues/44) you must use `forceChunkSize`
206+
Because of [Issue #44](https://github.com/coding-socks/laravel-upload-handler/issues/44) you must use `forceChunkSize`
207207
option.
208208

209209
### simple-uploader.js driver
@@ -212,7 +212,7 @@ option.
212212

213213
This driver handles requests made by the simple-uploader.js client library.
214214

215-
Because of [Issue #44](https://github.com/coding-socks/laravel-chunk-uploader/issues/44) you must use `forceChunkSize`
215+
Because of [Issue #44](https://github.com/coding-socks/laravel-upload-handler/issues/44) you must use `forceChunkSize`
216216
option.
217217

218218
## Identifiers

composer.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "coding-socks/laravel-chunk-uploader",
2+
"name": "coding-socks/laravel-upload-handler",
33
"description": "This package helps integrate a Laravel application with chunk uploader libraries eg. DropzoneJS and Resumable.js",
44
"type": "library",
55
"license": "MIT",
@@ -11,10 +11,6 @@
1111
{
1212
"name": "Choraimy Kroonstuiver",
1313
"homepage": "https://github.com/axlon"
14-
},
15-
{
16-
"name": "Raed Yak",
17-
"homepage": "https://github.com/yak0d3"
1814
}
1915
],
2016
"require": {
@@ -29,12 +25,12 @@
2925
},
3026
"autoload": {
3127
"psr-4": {
32-
"CodingSocks\\ChunkUploader\\": "src/"
28+
"CodingSocks\\UploadHandler\\": "src/"
3329
}
3430
},
3531
"autoload-dev": {
3632
"psr-4": {
37-
"CodingSocks\\ChunkUploader\\Tests\\": "tests/"
33+
"CodingSocks\\UploadHandler\\Tests\\": "tests/"
3834
}
3935
},
4036
"config": {
@@ -46,7 +42,7 @@
4642
},
4743
"laravel": {
4844
"providers": [
49-
"CodingSocks\\ChunkUploader\\ChunkUploaderServiceProvider"
45+
"CodingSocks\\UploadHandler\\UploadHandlerServiceProvider"
5046
]
5147
}
5248
}

config/chunk-uploader.php renamed to config/upload-handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
|
1818
*/
1919

20-
'uploader' => env('UPLOAD_DRIVER', 'monolith'),
20+
'handler' => env('UPLOAD_HANDLER', 'monolith'),
2121

2222
/*
2323
|--------------------------------------------------------------------------

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
verbose="true"
1717
>
1818
<testsuites>
19-
<testsuite name="Laravel Chunk Uploader Test Suite">
19+
<testsuite name="Laravel Upload Handler Test Suite">
2020
<directory>./tests</directory>
2121
</testsuite>
2222
</testsuites>

src/Driver/UploadDriver.php renamed to src/Driver/BaseHandler.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace CodingSocks\ChunkUploader\Driver;
3+
namespace CodingSocks\UploadHandler\Driver;
44

55
use Closure;
6-
use CodingSocks\ChunkUploader\Event\FileUploaded;
7-
use CodingSocks\ChunkUploader\Exception\InternalServerErrorHttpException;
8-
use CodingSocks\ChunkUploader\StorageConfig;
6+
use CodingSocks\UploadHandler\Event\FileUploaded;
7+
use CodingSocks\UploadHandler\Exception\InternalServerErrorHttpException;
8+
use CodingSocks\UploadHandler\StorageConfig;
99
use Illuminate\Http\Request;
1010
use Illuminate\Http\UploadedFile;
1111
use Illuminate\Support\Facades\Storage;
@@ -15,12 +15,12 @@
1515
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
1616
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
1717

18-
abstract class UploadDriver
18+
abstract class BaseHandler
1919
{
2020

2121
/**
2222
* @param \Illuminate\Http\Request $request
23-
* @param \CodingSocks\ChunkUploader\StorageConfig $config
23+
* @param \CodingSocks\UploadHandler\StorageConfig $config
2424
* @param \Closure|null $fileUploaded
2525
*
2626
* @return \Symfony\Component\HttpFoundation\Response
@@ -30,7 +30,7 @@ abstract public function handle(Request $request, StorageConfig $config, Closure
3030

3131
/**
3232
* @param string $filename
33-
* @param \CodingSocks\ChunkUploader\StorageConfig $storageConfig
33+
* @param \CodingSocks\UploadHandler\StorageConfig $storageConfig
3434
*
3535
* @return \Symfony\Component\HttpFoundation\Response
3636
*/
@@ -69,7 +69,7 @@ public function isRequestMethodIn(Request $request, array $methods): bool
6969
}
7070

7171
/**
72-
* Dispatch a {@link \CodingSocks\ChunkUploader\Event\FileUploaded} event.
72+
* Dispatch a {@link \CodingSocks\UploadHandler\Event\FileUploaded} event.
7373
* Also call the given {@link \Closure} if not null.
7474
*
7575
* @param $disk
@@ -91,7 +91,7 @@ protected function triggerFileUploadedEvent($disk, $path, Closure $fileUploaded
9191
* @param \Illuminate\Http\UploadedFile|null $file
9292
*
9393
* @throws \Symfony\Component\HttpKernel\Exception\BadRequestHttpException when given file is null.
94-
* @throws \CodingSocks\ChunkUploader\Exception\InternalServerErrorHttpException when given file is invalid.
94+
* @throws \CodingSocks\UploadHandler\Exception\InternalServerErrorHttpException when given file is invalid.
9595
*/
9696
protected function validateUploadedFile(UploadedFile $file = null): void
9797
{

src/Driver/BlueimpUploadDriver.php renamed to src/Driver/BlueimpBaseHandler.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22

3-
namespace CodingSocks\ChunkUploader\Driver;
3+
namespace CodingSocks\UploadHandler\Driver;
44

55
use Closure;
6-
use CodingSocks\ChunkUploader\Helper\ChunkHelpers;
7-
use CodingSocks\ChunkUploader\Identifier\Identifier;
8-
use CodingSocks\ChunkUploader\Range\ContentRange;
9-
use CodingSocks\ChunkUploader\Response\PercentageJsonResponse;
10-
use CodingSocks\ChunkUploader\StorageConfig;
6+
use CodingSocks\UploadHandler\Helper\ChunkHelpers;
7+
use CodingSocks\UploadHandler\Identifier\Identifier;
8+
use CodingSocks\UploadHandler\Range\ContentRange;
9+
use CodingSocks\UploadHandler\Response\PercentageJsonResponse;
10+
use CodingSocks\UploadHandler\StorageConfig;
1111
use Illuminate\Http\JsonResponse;
1212
use Illuminate\Http\Request;
1313
use Illuminate\Support\Arr;
@@ -18,7 +18,7 @@
1818
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
1919
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
2020

21-
class BlueimpUploadDriver extends UploadDriver
21+
class BlueimpBaseHandler extends BaseHandler
2222
{
2323
use ChunkHelpers;
2424

@@ -28,15 +28,15 @@ class BlueimpUploadDriver extends UploadDriver
2828
private $fileParam;
2929

3030
/**
31-
* @var \CodingSocks\ChunkUploader\Identifier\Identifier
31+
* @var \CodingSocks\UploadHandler\Identifier\Identifier
3232
*/
3333
private $identifier;
3434

3535
/**
36-
* BlueimpUploadDriver constructor.
36+
* BlueimpDriver constructor.
3737
*
3838
* @param array $config
39-
* @param \CodingSocks\ChunkUploader\Identifier\Identifier $identifier
39+
* @param \CodingSocks\UploadHandler\Identifier\Identifier $identifier
4040
*/
4141
public function __construct($config, Identifier $identifier)
4242
{
@@ -92,7 +92,7 @@ public function info(): Response
9292

9393
/**
9494
* @param \Illuminate\Http\Request $request
95-
* @param \CodingSocks\ChunkUploader\StorageConfig $config
95+
* @param \CodingSocks\UploadHandler\StorageConfig $config
9696
*
9797
* @return \Symfony\Component\HttpFoundation\Response
9898
*/
@@ -133,7 +133,7 @@ public function download(Request $request, StorageConfig $config): Response
133133

134134
/**
135135
* @param \Illuminate\Http\Request $request
136-
* @param \CodingSocks\ChunkUploader\StorageConfig $config
136+
* @param \CodingSocks\UploadHandler\StorageConfig $config
137137
* @param \Closure|null $fileUploaded
138138
*
139139
* @return \Symfony\Component\HttpFoundation\Response
@@ -177,7 +177,7 @@ public function save(Request $request, StorageConfig $config, Closure $fileUploa
177177

178178
/**
179179
* @param \Illuminate\Http\Request $request
180-
* @param \CodingSocks\ChunkUploader\StorageConfig $config
180+
* @param \CodingSocks\UploadHandler\StorageConfig $config
181181
*
182182
* @return \Symfony\Component\HttpFoundation\Response
183183
*/

src/Driver/DropzoneUploadDriver.php renamed to src/Driver/DropzoneBaseHandler.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?php
22

3-
namespace CodingSocks\ChunkUploader\Driver;
3+
namespace CodingSocks\UploadHandler\Driver;
44

55
use Closure;
6-
use CodingSocks\ChunkUploader\Helper\ChunkHelpers;
7-
use CodingSocks\ChunkUploader\Range\DropzoneRange;
8-
use CodingSocks\ChunkUploader\Response\PercentageJsonResponse;
9-
use CodingSocks\ChunkUploader\StorageConfig;
6+
use CodingSocks\UploadHandler\Helper\ChunkHelpers;
7+
use CodingSocks\UploadHandler\Range\DropzoneRange;
8+
use CodingSocks\UploadHandler\Response\PercentageJsonResponse;
9+
use CodingSocks\UploadHandler\StorageConfig;
1010
use Illuminate\Http\Request;
1111
use Illuminate\Http\UploadedFile;
1212
use InvalidArgumentException;
1313
use Symfony\Component\HttpFoundation\Response;
1414
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
1515
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
1616

17-
class DropzoneUploadDriver extends UploadDriver
17+
class DropzoneBaseHandler extends BaseHandler
1818
{
1919
use ChunkHelpers;
2020

@@ -24,7 +24,7 @@ class DropzoneUploadDriver extends UploadDriver
2424
private $fileParam;
2525

2626
/**
27-
* DropzoneUploadDriver constructor.
27+
* DropzoneDriver constructor.
2828
*
2929
* @param array $config
3030
*/
@@ -49,7 +49,7 @@ public function handle(Request $request, StorageConfig $config, Closure $fileUpl
4949

5050
/**
5151
* @param \Illuminate\Http\Request $request
52-
* @param \CodingSocks\ChunkUploader\StorageConfig $config
52+
* @param \CodingSocks\UploadHandler\StorageConfig $config
5353
* @param \Closure|null $fileUploaded
5454
*
5555
* @return \Symfony\Component\HttpFoundation\Response
@@ -101,7 +101,7 @@ private function validateChunkRequest(Request $request): void
101101

102102
/**
103103
* @param \Illuminate\Http\UploadedFile $file
104-
* @param \CodingSocks\ChunkUploader\StorageConfig $config
104+
* @param \CodingSocks\UploadHandler\StorageConfig $config
105105
* @param \Closure|null $fileUploaded
106106
*
107107
* @return \Symfony\Component\HttpFoundation\Response
@@ -120,7 +120,7 @@ private function saveMonolith(UploadedFile $file, StorageConfig $config, Closure
120120
/**
121121
* @param \Illuminate\Http\UploadedFile $file
122122
* @param \Illuminate\Http\Request $request
123-
* @param \CodingSocks\ChunkUploader\StorageConfig $config
123+
* @param \CodingSocks\UploadHandler\StorageConfig $config
124124
* @param \Closure|null $fileUploaded
125125
*
126126
* @return \Symfony\Component\HttpFoundation\Response

src/Driver/FlowJsUploadDriver.php renamed to src/Driver/FlowJsHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
namespace CodingSocks\ChunkUploader\Driver;
3+
namespace CodingSocks\UploadHandler\Driver;
44

5-
use CodingSocks\ChunkUploader\Identifier\Identifier;
5+
use CodingSocks\UploadHandler\Identifier\Identifier;
66

7-
class FlowJsUploadDriver extends ResumableJsUploadDriver
7+
class FlowJsHandler extends ResumableJsBaseHandler
88
{
99
public function __construct($config, Identifier $identifier)
1010
{

0 commit comments

Comments
 (0)