You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are welcome. To add a new provider just add a new Handler (which extends AbstractHandler). Then implement the chunk
4
-
upload and progress.
3
+
-[Pull Requests](#pull-requests)
4
+
-[Adding new library](#adding-new-library)
5
+
-[Your additions to your code base](#your-additions-to-your-code-base)
5
6
6
-
1. Fork the project.
7
-
2. Create your bugfix/feature branch and write your (try well-commented) code.
8
-
3. Commit your changes (and your tests) and push to your branch.
9
-
4. Create a new pull request against this package's `master` branch.
10
-
5.**Test your code in [laravel-chunk-upload-example](https://github.com/pionl/laravel-chunk-upload-example)**.
7
+
We welcome contributions to our project. If you want to add a new provider, follow these steps:
8
+
9
+
1.**Fork the Project:** Begin by forking the project to your own GitHub account.
10
+
2.**Create a Feature Branch:** Create a new branch for your bug fix or feature implementation. Ensure your code is well-commented.
11
+
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.
12
+
4.**Submit a Pull Request:** Once your changes are ready, submit a pull request to merge them into the main project's `master` branch.
13
+
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.
14
+
6.**Debugging Assistance:** If you encounter any issues, consider using XDEBUG for debugging purposes.
11
15
12
16
## Pull Requests
13
17
14
-
-**Use the [PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md).**
15
-
The easiest way to apply the conventions is to use `composer run lint:fix`.
18
+
When submitting pull requests, please adhere to the following guidelines:
19
+
20
+
-**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`.
-**Document Changes:** Document any changes in behavior thoroughly, ensuring that the `README.md` and other relevant documentation are updated accordingly.
16
25
17
-
-**Consider our release cycle.** We try to follow [SemVer v2.0.0](http://semver.org/).
26
+
-**Feature Branches:**Create feature branches for your pull requests rather than requesting to pull from your master branch directly.
18
27
19
-
-**Document any change in behaviour.** Make sure the `README.md` and any other relevant
20
-
documentation are kept up-to-date.
28
+
-**Single Feature per Pull Request:** Submit one pull request per feature. If you're implementing multiple features, send separate pull requests for each.
21
29
22
-
-**Create feature branches.** Don't ask us to pull from your master branch.
30
+
Before submitting your pull request:
23
31
24
-
-**One pull request per feature.** If you want to do more than one thing, send multiple pull requests.
32
+
1.**Rebase Changes:** Rebase your changes on the master branch to ensure a clean commit history.
33
+
2.**Lint Project:** Check for any coding standard violations using `composer run lint`.
34
+
3.**Run Tests:** Ensure that all tests pass by running `composer run test`.
35
+
4.**Write Tests (Recommended):** If possible, write tests to cover your code changes.
36
+
5.**Rebase Commits (Optional):** Consider rebasing your commits to keep them concise and relevant.
25
37
26
-
### Before pull-request do:
38
+
Thank you for your contributions!
27
39
28
-
1. Rebase your changes on master branch
29
-
2. Lint project `composer run lint`
30
-
3. Run tests `composer run test`
31
-
4. (recommended) Write tests
32
-
5. (optinal) Rebase your commits to fewer commits
33
-
34
-
**Thank you!**
40
+
# Adding new library
35
41
36
-
# Handler class
37
-
The basic handler `AbstractHandler` allows to implement own detection of the chunk mode and file naming. Stored in the Handler namespace but you can
38
-
store your handler at any namespace (you need to pass the class to the `FileReceiver` as a parameter)
42
+
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.
39
43
40
-
### You must implement:
44
+
### You Must Implement:
41
45
42
-
-`getChunkFileName()` - Returns the chunk file name for a storing the tmp file
43
-
-`isFirstChunk()` - Checks if the request has first chunk
44
-
-`isLastChunk()` - Checks if the current request has the last chunk
45
-
-`isChunkedUpload()` - Checks if the current request is chunked upload
46
-
-`getPercentageDone()` - Calculates the current uploaded percentage
46
+
-`getChunkFileName()`: Returns the chunk file name for storing the temporary file.
47
+
-`isFirstChunk()`: Checks if the request contains the first chunk.
48
+
-`isLastChunk()`: Checks if the current request contains the last chunk.
49
+
-`isChunkedUpload()`: Checks if the current request is a chunked upload.
50
+
-`getPercentageDone()`: Calculates the current upload percentage.
47
51
48
-
### Automatic detection
49
-
To enable your own detection, just overide the `canBeUsedForRequest` method
52
+
### Automatic Detection
53
+
54
+
To enable your own detection, simply override the `canBeUsedForRequest` method:
50
55
51
56
```php
52
57
public static function canBeUsedForRequest(Request $request)
@@ -55,8 +60,12 @@ public static function canBeUsedForRequest(Request $request)
55
60
}
56
61
```
57
62
58
-
# Fork
59
-
Edit the `HandlerFactory` and add your handler to the `$handlers` array
63
+
# Your additions to your code base
64
+
65
+
If you wish to contribute without forking, follow these steps:
66
+
67
+
1.**Edit HandlerFactory:** Add your handler to the `$handlers` array.
68
+
69
+
2.**Runtime Usage:** Call `HandlerFactory::register($name)` at runtime to register your custom Handler and utilize it.
60
70
61
-
# At runtime or without forking
62
-
Call the `HandlerFactory::register($name)` to register your own Handler at runtime and use it
71
+
Feel free to contribute and thank you for your support!
Copy file name to clipboardExpand all lines: readme.md
+24-31
Original file line number
Diff line number
Diff line change
@@ -8,80 +8,73 @@
8
8
9
9
## Introduction
10
10
11
-
> Supports Laravel from 5.2 to 9 (covered by integration tests for 7/8/9 versions).
11
+
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.
12
12
13
-
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.
13
+
For example repository with **integration tests**, visit [laravel-chunk-upload-example](https://github.com/pionl/laravel-chunk-upload-example).
14
14
15
-
Supports feature as [cross domains requests](https://github.com/pionl/laravel-chunk-upload/wiki/cross-domain-requests), automatic clean schedule and easy usage.
16
-
17
-
Example repository with **integration tests** can be found in [laravel-chunk-upload-example](https://github.com/pionl/laravel-chunk-upload-example).
18
-
19
-
> 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).
15
+
Before contributing, familiarize yourself with the guidelines outlined in CONTRIBUTION.md.
**Simultaneous uploads:** The library must send last chunk as last, otherwise the merging will not work correctly.
48
+
**Simultaneous Uploads:** The library must send the last chunk as the final one to ensure correct merging.
53
49
54
-
**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!).
50
+
**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!
55
51
56
-
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).
52
+
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).
57
53
58
54
## Changelog
59
55
60
-
Can be found in [releases](https://github.com/pionl/laravel-chunk-upload/releases).
56
+
View the changelog in [releases](https://github.com/pionl/laravel-chunk-upload/releases).
61
57
62
-
## Contribution or extending
58
+
## Contribution or Extension
63
59
64
-
> Read contribution before your PR (and use example repository to run integration tests).
60
+
Review the contribution guidelines before submitting your PRs (and utilize the example repository for running integration tests).
65
61
66
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for how to contribute changes. All contributions are welcome.
62
+
Refer to [CONTRIBUTING.md](CONTRIBUTING.md) for contribution instructions. All contributions are welcome.
67
63
68
64
## Compatibility
69
65
70
-
> Laravel 5/6 should be still supported but we are not testing them via automation sccripts
66
+
Though not tested via automation scripts, Laravel 5/6 should still be supported.
was written by [Martin Kluska](http://kluska.cz) and is released under the
85
-
[MIT License](LICENSE.md).
78
+
[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).
86
79
87
-
Copyright (c) 2016 and beyond Martin Kluska
80
+
Copyright (c) 2017 and beyond Martin Kluska and all contributors (Thank you ❤️)
0 commit comments