Skip to content

all: rename package #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build:
coverage:
tests:
override:
- command: ./vendor/bin/phpunit --coverage-clover=coverage.clover
- command: ./vendor/bin/phpunit --coverage-clover=build/coverage.clover
coverage:
file: coverage.clover
file: build/coverage.clover
format: clover
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Laravel Chunk Uploader
# Laravel Upload Handler

Chunk Uploader Package For Laravel
Upload Handler Package For Laravel

[![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")
[![Downloads Badge](https://poser.pugx.org/coding-socks/laravel-chunk-uploader/downloads)](https://packagist.org/packages/coding-socks/laravel-chunk-uploader)
[![Version Badge](https://poser.pugx.org/coding-socks/laravel-chunk-uploader/version)](https://packagist.org/packages/coding-socks/laravel-chunk-uploader)
[![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/)
[![License Badge](https://poser.pugx.org/coding-socks/laravel-chunk-uploader/license)](https://packagist.org/packages/coding-socks/laravel-chunk-uploader)
[![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")
[![Downloads Badge](https://poser.pugx.org/coding-socks/laravel-upload-handler/downloads)](https://packagist.org/packages/coding-socks/laravel-upload-handler)
[![Version Badge](https://poser.pugx.org/coding-socks/laravel-upload-handler/version)](https://packagist.org/packages/coding-socks/laravel-upload-handler)
[![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/)
[![License Badge](https://poser.pugx.org/coding-socks/laravel-upload-handler/license)](https://packagist.org/packages/coding-socks/laravel-upload-handler)

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

```bash
composer require coding-socks/laravel-chunk-uploader
composer require coding-socks/laravel-upload-handler
```

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

class MyController extends Controller
{
Expand All @@ -86,7 +86,7 @@ class MyController extends Controller
- Resolving from the app container
```php
use Illuminate\Http\Request;
use CodingSocks\ChunkUploader\UploadHandler;
use CodingSocks\UploadHandler\UploadHandler;

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

### Events

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

Expand Down Expand Up @@ -139,8 +139,8 @@ app()->make(UploadManager::class)->extend('my_driver', function () {
});
```

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

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

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

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

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

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

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

### simple-uploader.js driver
Expand All @@ -212,7 +212,7 @@ option.

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

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

## Identifiers
Expand Down
12 changes: 4 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "coding-socks/laravel-chunk-uploader",
"name": "coding-socks/laravel-upload-handler",
"description": "This package helps integrate a Laravel application with chunk uploader libraries eg. DropzoneJS and Resumable.js",
"type": "library",
"license": "MIT",
Expand All @@ -11,10 +11,6 @@
{
"name": "Choraimy Kroonstuiver",
"homepage": "https://github.com/axlon"
},
{
"name": "Raed Yak",
"homepage": "https://github.com/yak0d3"
}
],
"require": {
Expand All @@ -29,12 +25,12 @@
},
"autoload": {
"psr-4": {
"CodingSocks\\ChunkUploader\\": "src/"
"CodingSocks\\UploadHandler\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"CodingSocks\\ChunkUploader\\Tests\\": "tests/"
"CodingSocks\\UploadHandler\\Tests\\": "tests/"
}
},
"config": {
Expand All @@ -46,7 +42,7 @@
},
"laravel": {
"providers": [
"CodingSocks\\ChunkUploader\\ChunkUploaderServiceProvider"
"CodingSocks\\UploadHandler\\UploadHandlerServiceProvider"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/chunk-uploader.php → config/upload-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
|
*/

'uploader' => env('UPLOAD_DRIVER', 'monolith'),
'handler' => env('UPLOAD_HANDLER', 'monolith'),

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
verbose="true"
>
<testsuites>
<testsuite name="Laravel Chunk Uploader Test Suite">
<testsuite name="Laravel Upload Handler Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
Expand Down
18 changes: 9 additions & 9 deletions src/Driver/UploadDriver.php → src/Driver/BaseHandler.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace CodingSocks\ChunkUploader\Driver;
namespace CodingSocks\UploadHandler\Driver;

use Closure;
use CodingSocks\ChunkUploader\Event\FileUploaded;
use CodingSocks\ChunkUploader\Exception\InternalServerErrorHttpException;
use CodingSocks\ChunkUploader\StorageConfig;
use CodingSocks\UploadHandler\Event\FileUploaded;
use CodingSocks\UploadHandler\Exception\InternalServerErrorHttpException;
use CodingSocks\UploadHandler\StorageConfig;
use Illuminate\Http\Request;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
Expand All @@ -15,12 +15,12 @@
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

abstract class UploadDriver
abstract class BaseHandler
{

/**
* @param \Illuminate\Http\Request $request
* @param \CodingSocks\ChunkUploader\StorageConfig $config
* @param \CodingSocks\UploadHandler\StorageConfig $config
* @param \Closure|null $fileUploaded
*
* @return \Symfony\Component\HttpFoundation\Response
Expand All @@ -30,7 +30,7 @@ abstract public function handle(Request $request, StorageConfig $config, Closure

/**
* @param string $filename
* @param \CodingSocks\ChunkUploader\StorageConfig $storageConfig
* @param \CodingSocks\UploadHandler\StorageConfig $storageConfig
*
* @return \Symfony\Component\HttpFoundation\Response
*/
Expand Down Expand Up @@ -69,7 +69,7 @@ public function isRequestMethodIn(Request $request, array $methods): bool
}

/**
* Dispatch a {@link \CodingSocks\ChunkUploader\Event\FileUploaded} event.
* Dispatch a {@link \CodingSocks\UploadHandler\Event\FileUploaded} event.
* Also call the given {@link \Closure} if not null.
*
* @param $disk
Expand All @@ -91,7 +91,7 @@ protected function triggerFileUploadedEvent($disk, $path, Closure $fileUploaded
* @param \Illuminate\Http\UploadedFile|null $file
*
* @throws \Symfony\Component\HttpKernel\Exception\BadRequestHttpException when given file is null.
* @throws \CodingSocks\ChunkUploader\Exception\InternalServerErrorHttpException when given file is invalid.
* @throws \CodingSocks\UploadHandler\Exception\InternalServerErrorHttpException when given file is invalid.
*/
protected function validateUploadedFile(UploadedFile $file = null): void
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace CodingSocks\ChunkUploader\Driver;
namespace CodingSocks\UploadHandler\Driver;

use Closure;
use CodingSocks\ChunkUploader\Helper\ChunkHelpers;
use CodingSocks\ChunkUploader\Identifier\Identifier;
use CodingSocks\ChunkUploader\Range\ContentRange;
use CodingSocks\ChunkUploader\Response\PercentageJsonResponse;
use CodingSocks\ChunkUploader\StorageConfig;
use CodingSocks\UploadHandler\Helper\ChunkHelpers;
use CodingSocks\UploadHandler\Identifier\Identifier;
use CodingSocks\UploadHandler\Range\ContentRange;
use CodingSocks\UploadHandler\Response\PercentageJsonResponse;
use CodingSocks\UploadHandler\StorageConfig;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
Expand All @@ -18,7 +18,7 @@
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;

class BlueimpUploadDriver extends UploadDriver
class BlueimpBaseHandler extends BaseHandler
{
use ChunkHelpers;

Expand All @@ -28,15 +28,15 @@ class BlueimpUploadDriver extends UploadDriver
private $fileParam;

/**
* @var \CodingSocks\ChunkUploader\Identifier\Identifier
* @var \CodingSocks\UploadHandler\Identifier\Identifier
*/
private $identifier;

/**
* BlueimpUploadDriver constructor.
* BlueimpDriver constructor.
*
* @param array $config
* @param \CodingSocks\ChunkUploader\Identifier\Identifier $identifier
* @param \CodingSocks\UploadHandler\Identifier\Identifier $identifier
*/
public function __construct($config, Identifier $identifier)
{
Expand Down Expand Up @@ -92,7 +92,7 @@ public function info(): Response

/**
* @param \Illuminate\Http\Request $request
* @param \CodingSocks\ChunkUploader\StorageConfig $config
* @param \CodingSocks\UploadHandler\StorageConfig $config
*
* @return \Symfony\Component\HttpFoundation\Response
*/
Expand Down Expand Up @@ -133,7 +133,7 @@ public function download(Request $request, StorageConfig $config): Response

/**
* @param \Illuminate\Http\Request $request
* @param \CodingSocks\ChunkUploader\StorageConfig $config
* @param \CodingSocks\UploadHandler\StorageConfig $config
* @param \Closure|null $fileUploaded
*
* @return \Symfony\Component\HttpFoundation\Response
Expand Down Expand Up @@ -177,7 +177,7 @@ public function save(Request $request, StorageConfig $config, Closure $fileUploa

/**
* @param \Illuminate\Http\Request $request
* @param \CodingSocks\ChunkUploader\StorageConfig $config
* @param \CodingSocks\UploadHandler\StorageConfig $config
*
* @return \Symfony\Component\HttpFoundation\Response
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?php

namespace CodingSocks\ChunkUploader\Driver;
namespace CodingSocks\UploadHandler\Driver;

use Closure;
use CodingSocks\ChunkUploader\Helper\ChunkHelpers;
use CodingSocks\ChunkUploader\Range\DropzoneRange;
use CodingSocks\ChunkUploader\Response\PercentageJsonResponse;
use CodingSocks\ChunkUploader\StorageConfig;
use CodingSocks\UploadHandler\Helper\ChunkHelpers;
use CodingSocks\UploadHandler\Range\DropzoneRange;
use CodingSocks\UploadHandler\Response\PercentageJsonResponse;
use CodingSocks\UploadHandler\StorageConfig;
use Illuminate\Http\Request;
use Illuminate\Http\UploadedFile;
use InvalidArgumentException;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;

class DropzoneUploadDriver extends UploadDriver
class DropzoneBaseHandler extends BaseHandler
{
use ChunkHelpers;

Expand All @@ -24,7 +24,7 @@ class DropzoneUploadDriver extends UploadDriver
private $fileParam;

/**
* DropzoneUploadDriver constructor.
* DropzoneDriver constructor.
*
* @param array $config
*/
Expand All @@ -49,7 +49,7 @@ public function handle(Request $request, StorageConfig $config, Closure $fileUpl

/**
* @param \Illuminate\Http\Request $request
* @param \CodingSocks\ChunkUploader\StorageConfig $config
* @param \CodingSocks\UploadHandler\StorageConfig $config
* @param \Closure|null $fileUploaded
*
* @return \Symfony\Component\HttpFoundation\Response
Expand Down Expand Up @@ -101,7 +101,7 @@ private function validateChunkRequest(Request $request): void

/**
* @param \Illuminate\Http\UploadedFile $file
* @param \CodingSocks\ChunkUploader\StorageConfig $config
* @param \CodingSocks\UploadHandler\StorageConfig $config
* @param \Closure|null $fileUploaded
*
* @return \Symfony\Component\HttpFoundation\Response
Expand All @@ -120,7 +120,7 @@ private function saveMonolith(UploadedFile $file, StorageConfig $config, Closure
/**
* @param \Illuminate\Http\UploadedFile $file
* @param \Illuminate\Http\Request $request
* @param \CodingSocks\ChunkUploader\StorageConfig $config
* @param \CodingSocks\UploadHandler\StorageConfig $config
* @param \Closure|null $fileUploaded
*
* @return \Symfony\Component\HttpFoundation\Response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace CodingSocks\ChunkUploader\Driver;
namespace CodingSocks\UploadHandler\Driver;

use CodingSocks\ChunkUploader\Identifier\Identifier;
use CodingSocks\UploadHandler\Identifier\Identifier;

class FlowJsUploadDriver extends ResumableJsUploadDriver
class FlowJsHandler extends ResumableJsBaseHandler
{
public function __construct($config, Identifier $identifier)
{
Expand Down
Loading