From e1ffe87e8a50a6a8cf8204c6afd46f6df99083e6 Mon Sep 17 00:00:00 2001 From: shivank44 <52524465+shivank44@users.noreply.github.com> Date: Wed, 31 Aug 2022 13:00:45 +0530 Subject: [PATCH 01/15] Fix issue for file having large name (#125) --- src/Handler/ResumableJSUploadHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handler/ResumableJSUploadHandler.php b/src/Handler/ResumableJSUploadHandler.php index 59f79f2..7a70ae9 100644 --- a/src/Handler/ResumableJSUploadHandler.php +++ b/src/Handler/ResumableJSUploadHandler.php @@ -43,7 +43,7 @@ public function __construct(Request $request, $file, $config) */ public function getChunkFileName() { - return $this->createChunkFileName($this->fileUuid, $this->getCurrentChunk()); + return $this->createChunkFileName(substr($this->fileUuid,0,40), $this->getCurrentChunk()); } /** From a4037fcaf6b82ff4b4f58387fb7dce463de4c65f Mon Sep 17 00:00:00 2001 From: Ronaldo Cesar Paggi Date: Wed, 12 Oct 2022 11:01:42 -0300 Subject: [PATCH 02/15] Update Dropzone repository url --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index e1c31cb..eb0fce3 100644 --- a/readme.md +++ b/readme.md @@ -43,7 +43,7 @@ Setup consists of 3 steps: | Library | Wiki | single & chunk upload | simultaneous uploads | In [example project](https://github.com/pionl/laravel-chunk-upload-example) | Author | |---- |----|----|----| ---- | ---- | | [resumable.js](https://github.com/23/resumable.js) | [Wiki](https://github.com/pionl/laravel-chunk-upload/wiki/resumable-js) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | [@pionl](https://github.com/pionl) | -| [DropZone](https://gitlab.com/meno/dropzone/) | [Wiki](https://github.com/pionl/laravel-chunk-upload/wiki/dropzone) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | [@pionl](https://github.com/pionl) | +| [DropZone](https://github.com/dropzone/dropzone) | [Wiki](https://github.com/pionl/laravel-chunk-upload/wiki/dropzone) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | [@pionl](https://github.com/pionl) | | [jQuery-File-Upload](https://github.com/blueimp/jQuery-File-Upload) | [Wiki](https://github.com/pionl/laravel-chunk-upload/wiki/jquery-file-upload) | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_check_mark: | [@pionl](https://github.com/pionl) | | [Plupload](https://github.com/moxiecode/plupload) | [Wiki](https://github.com/pionl/laravel-chunk-upload/wiki/plupload) | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_multiplication_x: | [@pionl](https://github.com/pionl) | | [simple uploader](https://github.com/simple-uploader) | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_multiplication_x: | [@dyktek](https://github.com/dyktek) | From 49c84c699c940de4cc18d34a987e169e08802a30 Mon Sep 17 00:00:00 2001 From: Vedmant Date: Tue, 1 Nov 2022 17:10:31 -0500 Subject: [PATCH 03/15] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index eb0fce3..8766c3a 100644 --- a/readme.md +++ b/readme.md @@ -8,7 +8,7 @@ ## Introduction -> Supports Laravel from 5.2 to 7 (covered by integration tests on all versions). +> Supports Laravel from 5.2 to 9 (covered by integration tests for 7/8/9 versions). Easy to use service/library for chunked upload with supporting multiple JS libraries on top of Laravel's file upload with low memory footprint in mind. From dcf5cf42059910242c31fc34d0ea147d07478473 Mon Sep 17 00:00:00 2001 From: Martin Kluska Date: Wed, 15 Mar 2023 22:02:42 +0100 Subject: [PATCH 04/15] Add Laravel 10 support + upgrade to PHPUnit 10 --- .gitignore | 1 + composer.json | 10 +++++----- phpunit.xml.dist | 30 +++++++++++------------------- readme.md | 14 ++++++-------- 4 files changed, 23 insertions(+), 32 deletions(-) diff --git a/.gitignore b/.gitignore index b9b19b9..6473415 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ composer.lock /build .phpunit.result.cache .php_cs.cache +/.phpunit.cache diff --git a/composer.json b/composer.json index 6e73b7b..b0ecb74 100644 --- a/composer.json +++ b/composer.json @@ -15,13 +15,13 @@ "test": "./vendor/bin/phpunit" }, "require": { - "illuminate/http": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0", - "illuminate/console": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0", - "illuminate/support": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0", - "illuminate/filesystem": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0" + "illuminate/http": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", + "illuminate/console": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", + "illuminate/support": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", + "illuminate/filesystem": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0" }, "require-dev": { - "phpunit/phpunit": "5.7 | 6.0 | 7.0 | 7.5 | 8.4 | ^8.5 | ^9.3", + "phpunit/phpunit": "5.7 | 6.0 | 7.0 | 7.5 | 8.4 | ^8.5 | ^9.3 | ^10.0", "mockery/mockery": "^1.1.0 | ^1.3.0", "friendsofphp/php-cs-fixer": "^2.16.0", "overtrue/phplint": "^1.1 | ^2.0" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index da32b83..6d07324 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,21 +1,13 @@ - - - - ./tests/ - - - - - src/ - - + + + + src/ + + + + + ./tests/ + + diff --git a/readme.md b/readme.md index 8766c3a..ccc05c8 100644 --- a/readme.md +++ b/readme.md @@ -69,14 +69,12 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for how to contribute changes. All contri > Laravel 5/6 should be still supported but we are not testing them via automation sccripts -| Version | PHP | -| ------- | ----------- | -| 9.* | 8.1-node-17 | -| 9.* | 8.0-node-17 | -| 8.* | 8.1-node-17 | -| 8.* | 8.0-node-17 | -| 8.* | 7.4-node-17 | -| 7.* | 7.4-node-17 | +| Version | PHP | +|---------|---------------| +| 10.* | 8.1, 8.2 | +| 9.* | 8.0, 8.1 | +| 8.* | 7.4, 8.0, 8.1 | +| 7.* | 7.4 | From 0564c77e451650408bd59090f3686e9bab781fb9 Mon Sep 17 00:00:00 2001 From: Martin Kluska Date: Sat, 18 Mar 2023 19:02:34 +0100 Subject: [PATCH 05/15] Run tests also on PHP 8.2 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 834c8e0..9292b34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: ['7.2', '7.3', '7.4', '8.0', '8.1'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] steps: - name: Checkout @@ -29,4 +29,4 @@ jobs: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi - name: Run unit tests - run: vendor/bin/phpunit --verbose --colors=always \ No newline at end of file + run: vendor/bin/phpunit --colors=always From 42cc565d3f3140d3bff0470dc659187fb2099433 Mon Sep 17 00:00:00 2001 From: Will Mercer <45526202+r0aringthunder@users.noreply.github.com> Date: Tue, 19 Mar 2024 08:17:08 -0500 Subject: [PATCH 06/15] Add support Laravel 11 --- composer.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/composer.json b/composer.json index b0ecb74..06a1542 100644 --- a/composer.json +++ b/composer.json @@ -15,16 +15,16 @@ "test": "./vendor/bin/phpunit" }, "require": { - "illuminate/http": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", - "illuminate/console": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", - "illuminate/support": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0", - "illuminate/filesystem": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0" + "illuminate/http": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0", + "illuminate/console": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0", + "illuminate/support": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0", + "illuminate/filesystem": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0" }, "require-dev": { - "phpunit/phpunit": "5.7 | 6.0 | 7.0 | 7.5 | 8.4 | ^8.5 | ^9.3 | ^10.0", - "mockery/mockery": "^1.1.0 | ^1.3.0", - "friendsofphp/php-cs-fixer": "^2.16.0", - "overtrue/phplint": "^1.1 | ^2.0" + "phpunit/phpunit": "5.7 | 6.0 | 7.0 | 7.5 | 8.4 | ^8.5 | ^9.3 | ^10.0 | ^11.0", + "mockery/mockery": "^1.1.0 | ^1.3.0 | ^1.6.0", + "friendsofphp/php-cs-fixer": "^2.16.0 | ^3.52.0", + "overtrue/phplint": "^1.1 | ^2.0 | ^9.1" }, "autoload": { "psr-4": { From 2212c8e733bf1b335345d77ead3c617622f4d1db Mon Sep 17 00:00:00 2001 From: Martin Kluska Date: Tue, 19 Mar 2024 20:06:26 +0100 Subject: [PATCH 07/15] Improve the readme / contribution --- CONTRIBUTING.md | 85 +++++++++++++++++++++++++++---------------------- readme.md | 55 ++++++++++++++------------------ 2 files changed, 71 insertions(+), 69 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ddf880e..44c1a93 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,52 +1,57 @@ -# Contribution or overriding +# Contribution Guidelines -Are welcome. To add a new provider just add a new Handler (which extends AbstractHandler). Then implement the chunk -upload and progress. +- [Pull Requests](#pull-requests) +- [Adding new library](#adding-new-library) +- [Your additions to your code base](#your-additions-to-your-code-base) -1. Fork the project. -2. Create your bugfix/feature branch and write your (try well-commented) code. -3. Commit your changes (and your tests) and push to your branch. -4. Create a new pull request against this package's `master` branch. -5. **Test your code in [laravel-chunk-upload-example](https://github.com/pionl/laravel-chunk-upload-example)**. +We welcome contributions to our project. If you want to add a new provider, follow these steps: + +1. **Fork the Project:** Begin by forking the project to your own GitHub account. +2. **Create a Feature Branch:** Create a new branch for your bug fix or feature implementation. Ensure your code is well-commented. +3. **Commit and Push Changes:** Make your changes, including any necessary tests, and commit them to your branch. Then, push your changes to your forked repository. +4. **Submit a Pull Request:** Once your changes are ready, submit a pull request to merge them into the main project's `master` branch. +5. **Test Your Code:** Before submitting your pull request, ensure that your code works properly by testing it in the [laravel-chunk-upload-example](https://github.com/pionl/laravel-chunk-upload-example) project. +6. **Debugging Assistance:** If you encounter any issues, consider using XDEBUG for debugging purposes. ## Pull Requests -- **Use the [PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md).** - The easiest way to apply the conventions is to use `composer run lint:fix`. +When submitting pull requests, please adhere to the following guidelines: + +- **Coding Standards:** Follow the [PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md). You can easily apply these conventions using `composer run lint:fix`. + +- **Release Cycle:** Consider our release cycle, aiming to follow [SemVer v2.0.0](http://semver.org/). + +- **Document Changes:** Document any changes in behavior thoroughly, ensuring that the `README.md` and other relevant documentation are updated accordingly. -- **Consider our release cycle.** We try to follow [SemVer v2.0.0](http://semver.org/). +- **Feature Branches:** Create feature branches for your pull requests rather than requesting to pull from your master branch directly. -- **Document any change in behaviour.** Make sure the `README.md` and any other relevant - documentation are kept up-to-date. +- **Single Feature per Pull Request:** Submit one pull request per feature. If you're implementing multiple features, send separate pull requests for each. -- **Create feature branches.** Don't ask us to pull from your master branch. +Before submitting your pull request: -- **One pull request per feature.** If you want to do more than one thing, send multiple pull requests. +1. **Rebase Changes:** Rebase your changes on the master branch to ensure a clean commit history. +2. **Lint Project:** Check for any coding standard violations using `composer run lint`. +3. **Run Tests:** Ensure that all tests pass by running `composer run test`. +4. **Write Tests (Recommended):** If possible, write tests to cover your code changes. +5. **Rebase Commits (Optional):** Consider rebasing your commits to keep them concise and relevant. -### Before pull-request do: +Thank you for your contributions! -1. Rebase your changes on master branch -2. Lint project `composer run lint` -3. Run tests `composer run test` -4. (recommended) Write tests -5. (optinal) Rebase your commits to fewer commits - -**Thank you!** +# Adding new library -# Handler class -The basic handler `AbstractHandler` allows to implement own detection of the chunk mode and file naming. Stored in the Handler namespace but you can -store your handler at any namespace (you need to pass the class to the `FileReceiver` as a parameter) +The `AbstractHandler` class provides a foundation for implementing custom detection of chunk mode and file naming. While it's stored in the Handler namespace by default, you can place your handler in any namespace and pass the class to the `FileReceiver` as a parameter. -### You must implement: +### You Must Implement: -- `getChunkFileName()` - Returns the chunk file name for a storing the tmp file -- `isFirstChunk()` - Checks if the request has first chunk -- `isLastChunk()` - Checks if the current request has the last chunk -- `isChunkedUpload()` - Checks if the current request is chunked upload -- `getPercentageDone()` - Calculates the current uploaded percentage +- `getChunkFileName()`: Returns the chunk file name for storing the temporary file. +- `isFirstChunk()`: Checks if the request contains the first chunk. +- `isLastChunk()`: Checks if the current request contains the last chunk. +- `isChunkedUpload()`: Checks if the current request is a chunked upload. +- `getPercentageDone()`: Calculates the current upload percentage. -### Automatic detection -To enable your own detection, just overide the `canBeUsedForRequest` method +### Automatic Detection + +To enable your own detection, simply override the `canBeUsedForRequest` method: ```php public static function canBeUsedForRequest(Request $request) @@ -55,8 +60,12 @@ public static function canBeUsedForRequest(Request $request) } ``` -# Fork -Edit the `HandlerFactory` and add your handler to the `$handlers` array +# Your additions to your code base + +If you wish to contribute without forking, follow these steps: + +1. **Edit HandlerFactory:** Add your handler to the `$handlers` array. + +2. **Runtime Usage:** Call `HandlerFactory::register($name)` at runtime to register your custom Handler and utilize it. -# At runtime or without forking -Call the `HandlerFactory::register($name)` to register your own Handler at runtime and use it +Feel free to contribute and thank you for your support! diff --git a/readme.md b/readme.md index ccc05c8..bc8629e 100644 --- a/readme.md +++ b/readme.md @@ -8,40 +8,36 @@ ## Introduction -> Supports Laravel from 5.2 to 9 (covered by integration tests for 7/8/9 versions). +Laravel Chunk Upload simplifies chunked uploads with support for multiple JavaScript libraries atop Laravel's file upload system, designed with a minimal memory footprint. Features include cross-domain request support, automatic cleaning, and intuitive usage. -Easy to use service/library for chunked upload with supporting multiple JS libraries on top of Laravel's file upload with low memory footprint in mind. +For example repository with **integration tests**, visit [laravel-chunk-upload-example](https://github.com/pionl/laravel-chunk-upload-example). -Supports feature as [cross domains requests](https://github.com/pionl/laravel-chunk-upload/wiki/cross-domain-requests), automatic clean schedule and easy usage. - -Example repository with **integration tests** can be found in [laravel-chunk-upload-example](https://github.com/pionl/laravel-chunk-upload-example). - -> Before adding pull requests read CONTRIBUTION.md. Help me fix your bugs by debugging your issues using XDEBUG (and try to do a fix - it will help you become better). +Before contributing, familiarize yourself with the guidelines outlined in CONTRIBUTION.md. ## Installation -**1. Install via composer** +**1. Install via Composer** -``` +```bash composer require pion/laravel-chunk-upload ``` -**2. Publish the config (Optional)** +**2. Publish the Configuration (Optional)** -``` +```bash php artisan vendor:publish --provider="Pion\Laravel\ChunkUpload\Providers\ChunkUploadServiceProvider" ``` ## Usage -Setup consists of 3 steps: +The setup involves three steps: -1. Integrate your controller that will handle the file upload. [How to](https://github.com/pionl/laravel-chunk-upload/wiki/controller) -2. Set a route for the controller. [How to](https://github.com/pionl/laravel-chunk-upload/wiki/routing) -2. Choose your front-end provider below (we support multiple providers in single controller) +1. Integrate your controller to handle file uploads. [Instructions](https://github.com/pionl/laravel-chunk-upload/wiki/controller) +2. Define a route for the controller. [Instructions](https://github.com/pionl/laravel-chunk-upload/wiki/routing) +3. Select your preferred frontend provider (multiple providers are supported in a single controller). -| Library | Wiki | single & chunk upload | simultaneous uploads | In [example project](https://github.com/pionl/laravel-chunk-upload-example) | Author | -|---- |----|----|----| ---- | ---- | +| Library | Wiki | Single & Chunk Upload | Simultaneous Uploads | Included in [Example Project](https://github.com/pionl/laravel-chunk-upload-example) | Author | +|---------|------|-----------------------|----------------------|--------------------------------------------------|--------| | [resumable.js](https://github.com/23/resumable.js) | [Wiki](https://github.com/pionl/laravel-chunk-upload/wiki/resumable-js) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | [@pionl](https://github.com/pionl) | | [DropZone](https://github.com/dropzone/dropzone) | [Wiki](https://github.com/pionl/laravel-chunk-upload/wiki/dropzone) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | [@pionl](https://github.com/pionl) | | [jQuery-File-Upload](https://github.com/blueimp/jQuery-File-Upload) | [Wiki](https://github.com/pionl/laravel-chunk-upload/wiki/jquery-file-upload) | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_check_mark: | [@pionl](https://github.com/pionl) | @@ -49,39 +45,36 @@ Setup consists of 3 steps: | [simple uploader](https://github.com/simple-uploader) | :heavy_multiplication_x: | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_multiplication_x: | [@dyktek](https://github.com/dyktek) | | [ng-file-upload](https://github.com/danialfarid/ng-file-upload) | [Wiki](https://github.com/pionl/laravel-chunk-upload/wiki/ng-file-upload) | :heavy_check_mark: | :heavy_multiplication_x: | :heavy_multiplication_x: | [@L3o-pold](https://github.com/L3o-pold) | -**Simultaneous uploads:** The library must send last chunk as last, otherwise the merging will not work correctly. +**Simultaneous Uploads:** The library must send the last chunk as the final one to ensure correct merging. -**Custom disk:** At this moment I recommend using the basic storage setup (not linking public folder). It is not tested (Have free time to ensure it is working? PR the changes!). +**Custom Disk:** Currently, it's recommended to use the basic storage setup (not linking the public folder). If you have time to verify its functionality, please PR the changes! -For more detailed information (tips) use the [Wiki](https://github.com/pionl/laravel-chunk-upload/wiki) or for working example continue to separate repository with [example](https://github.com/pionl/laravel-chunk-upload-example). +For detailed information and tips, refer to the [Wiki](https://github.com/pionl/laravel-chunk-upload/wiki) or explore a working example in a separate repository with [example](https://github.com/pionl/laravel-chunk-upload-example). ## Changelog -Can be found in [releases](https://github.com/pionl/laravel-chunk-upload/releases). +View the changelog in [releases](https://github.com/pionl/laravel-chunk-upload/releases). -## Contribution or extending +## Contribution or Extension -> Read contribution before your PR (and use example repository to run integration tests). +Review the contribution guidelines before submitting your PRs (and utilize the example repository for running integration tests). -See [CONTRIBUTING.md](CONTRIBUTING.md) for how to contribute changes. All contributions are welcome. +Refer to [CONTRIBUTING.md](CONTRIBUTING.md) for contribution instructions. All contributions are welcome. ## Compatibility -> Laravel 5/6 should be still supported but we are not testing them via automation sccripts +Though not tested via automation scripts, Laravel 5/6 should still be supported. | Version | PHP | |---------|---------------| +| 11.* | 8.2 | | 10.* | 8.1, 8.2 | | 9.* | 8.0, 8.1 | | 8.* | 7.4, 8.0, 8.1 | | 7.* | 7.4 | - - ## Copyright and License -[laravel-chunk-upload](https://github.com/pionl/laravel-chunk-upload) -was written by [Martin Kluska](http://kluska.cz) and is released under the -[MIT License](LICENSE.md). +[laravel-chunk-upload](https://github.com/pionl/laravel-chunk-upload) was authored by [Martin Kluska](http://kluska.cz) and is released under the [MIT License](LICENSE.md). -Copyright (c) 2016 and beyond Martin Kluska +Copyright (c) 2017 and beyond Martin Kluska and all contributors (Thank you ❤️) From e19222324438f92c778586d772e67686d9ae1494 Mon Sep 17 00:00:00 2001 From: Martin Kluska Date: Tue, 19 Mar 2024 20:07:07 +0100 Subject: [PATCH 08/15] Remove unstable version badge --- readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/readme.md b/readme.md index bc8629e..4953ee2 100644 --- a/readme.md +++ b/readme.md @@ -3,7 +3,6 @@ [![Total Downloads](https://poser.pugx.org/pion/laravel-chunk-upload/downloads?format=flat)](https://packagist.org/packages/pion/laravel-chunk-upload) [![Build Status](https://github.com/pionl/laravel-chunk-upload/workflows/build/badge.svg)](https://github.com/pionl/laravel-chunk-upload/actions) [![Latest Stable Version](https://poser.pugx.org/pion/laravel-chunk-upload/v/stable?format=flat)](https://packagist.org/packages/pion/laravel-chunk-upload) -[![Latest Unstable Version](https://poser.pugx.org/pion/laravel-chunk-upload/v/unstable?format=flat)](https://packagist.org/packages/pion/laravel-chunk-upload) [![License](https://poser.pugx.org/pion/laravel-chunk-upload/license)](https://packagist.org/packages/pion/laravel-chunk-upload) ## Introduction From cfbc4292ddcace51308a4f2f446d310aa04e6133 Mon Sep 17 00:00:00 2001 From: Richard Tippin Date: Fri, 22 Mar 2024 19:36:31 -0400 Subject: [PATCH 09/15] Set "$contentRange" default to empty string if header key not found. Passing "null" to the second argument of preg_match is deprecated. --- src/Handler/ContentRangeUploadHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handler/ContentRangeUploadHandler.php b/src/Handler/ContentRangeUploadHandler.php index d2b2e3a..9442d47 100644 --- a/src/Handler/ContentRangeUploadHandler.php +++ b/src/Handler/ContentRangeUploadHandler.php @@ -67,7 +67,7 @@ public function __construct(Request $request, $file, $config) { parent::__construct($request, $file, $config); - $contentRange = $this->request->header(self::CONTENT_RANGE_INDEX); + $contentRange = $this->request->header(self::CONTENT_RANGE_INDEX, ''); $this->tryToParseContentRange($contentRange); } From 41b5c152f720ea2f3c791d21e679f9088f183f27 Mon Sep 17 00:00:00 2001 From: Simon Verwaard Date: Mon, 24 Feb 2025 22:00:07 +0100 Subject: [PATCH 10/15] chore: Add support for Laravel 12 --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 06a1542..6782ab5 100644 --- a/composer.json +++ b/composer.json @@ -15,10 +15,10 @@ "test": "./vendor/bin/phpunit" }, "require": { - "illuminate/http": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0", - "illuminate/console": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0", - "illuminate/support": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0", - "illuminate/filesystem": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0" + "illuminate/http": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0 | ^12.0", + "illuminate/console": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0 | ^12.0", + "illuminate/support": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0 | ^12.0", + "illuminate/filesystem": "5.2 - 5.8 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0 | ^12.0" }, "require-dev": { "phpunit/phpunit": "5.7 | 6.0 | 7.0 | 7.5 | 8.4 | ^8.5 | ^9.3 | ^10.0 | ^11.0", From 16115fe080727d9e94d9b4dc3edfb6715623af91 Mon Sep 17 00:00:00 2001 From: Martin Kluska Date: Wed, 19 Mar 2025 16:25:24 +0100 Subject: [PATCH 11/15] Update compability --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 4953ee2..febc73d 100644 --- a/readme.md +++ b/readme.md @@ -66,7 +66,8 @@ Though not tested via automation scripts, Laravel 5/6 should still be supported. | Version | PHP | |---------|---------------| -| 11.* | 8.2 | +| 12.* | 8.2,8.3,8.4 | +| 11.* | 8.2,8.3,8.4 | | 10.* | 8.1, 8.2 | | 9.* | 8.0, 8.1 | | 8.* | 7.4, 8.0, 8.1 | From 4a6fe191e2c58c8b6eaf3b8b902d359347389d1c Mon Sep 17 00:00:00 2001 From: ISMAIL MAHMOUD Date: Sun, 9 Mar 2025 10:43:00 +0300 Subject: [PATCH 12/15] use Laravel Session Facade --- src/Handler/AbstractHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handler/AbstractHandler.php b/src/Handler/AbstractHandler.php index d5a523a..27c7119 100644 --- a/src/Handler/AbstractHandler.php +++ b/src/Handler/AbstractHandler.php @@ -4,10 +4,10 @@ use Illuminate\Http\Request; use Illuminate\Http\UploadedFile; +use Illuminate\Support\Facades\Session; use Pion\Laravel\ChunkUpload\Config\AbstractConfig; use Pion\Laravel\ChunkUpload\Save\AbstractSave; use Pion\Laravel\ChunkUpload\Storage\ChunkStorage; -use Session; /** * The handler that will detect if we can continue the chunked upload. From 03fb642790fa4fa1059bed95853567cc827091ec Mon Sep 17 00:00:00 2001 From: Jesper Noordsij <45041769+jnoordsij@users.noreply.github.com> Date: Wed, 19 Mar 2025 16:05:08 +0100 Subject: [PATCH 13/15] Run tests on PHP 8.3 and 8.4 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9292b34..acbf827 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] + php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] steps: - name: Checkout From 5cfdb8d9058bb4ecdf3a3100b6c7bb197c21e4d4 Mon Sep 17 00:00:00 2001 From: Martin Kluska Date: Wed, 19 Mar 2025 17:30:08 +0100 Subject: [PATCH 14/15] Info about using PR --- readme.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/readme.md b/readme.md index febc73d..66e27bc 100644 --- a/readme.md +++ b/readme.md @@ -73,6 +73,21 @@ Though not tested via automation scripts, Laravel 5/6 should still be supported. | 8.* | 7.4, 8.0, 8.1 | | 7.* | 7.4 | +### New versions + +If there is a new Laravel version and there is not a offical release you can create a PR and then any one can use the PR until offical release is made. Check the PR and and update composer.json with the repository. + +``` +"repositories": [ + { + "type": "vcs", + "url": "https://github.com/{!ENTER_USER_NAME!}/laravel-chunk-upload" + } + ] +``` + +Here is [exmplanation article](https://putyourlightson.com/articles/requiring-a-forked-repo-with-composer) + ## Copyright and License [laravel-chunk-upload](https://github.com/pionl/laravel-chunk-upload) was authored by [Martin Kluska](http://kluska.cz) and is released under the [MIT License](LICENSE.md). From 9ab6832b209ba19f6a17c38b48c8489e22c9877d Mon Sep 17 00:00:00 2001 From: Martin Kluska Date: Wed, 19 Mar 2025 17:53:24 +0100 Subject: [PATCH 15/15] Readme improvements --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 66e27bc..89c1f55 100644 --- a/readme.md +++ b/readme.md @@ -75,7 +75,7 @@ Though not tested via automation scripts, Laravel 5/6 should still be supported. ### New versions -If there is a new Laravel version and there is not a offical release you can create a PR and then any one can use the PR until offical release is made. Check the PR and and update composer.json with the repository. +If there is a new Laravel version and there is no a offical release in our package you can create a PR. Then any one can use the PR until offical release is made. Check the PR and and update composer.json with the repository. ``` "repositories": [