Are welcome. To add a new provider just add a new Handler (which extends AbstractHandler). Then implement the chunk upload and progress.
- Fork the project.
- Create your bugfix/feature branch and write your (try well-commented) code.
- Commit your changes (and your tests) and push to your branch.
- Create a new pull request against this package's
master
branch.
-
Use the PSR-2 Coding Standard. The easiest way to apply the conventions is to use
composer run lint:fix
. -
Consider our release cycle. We try to follow SemVer v2.0.0.
-
Document any change in behaviour. Make sure the
README.md
and any other relevant documentation are kept up-to-date. -
Create feature branches. Don't ask us to pull from your master branch.
-
One pull request per feature. If you want to do more than one thing, send multiple pull requests.
- Rebase your changes on master branch
- Lint project
composer run lint
- Run tests
composer run test
- (recommended) Write tests
- (optinal) Rebase your commits to fewer commits
Thank you!
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)
getChunkFileName()
- Returns the chunk file name for a storing the tmp fileisFirstChunk()
- Checks if the request has first chunkisLastChunk()
- Checks if the current request has the last chunkisChunkedUpload()
- Checks if the current request is chunked uploadgetPercentageDone()
- Calculates the current uploaded percentage
To enable your own detection, just overide the canBeUsedForRequest
method
public static function canBeUsedForRequest(Request $request)
{
return true;
}
Edit the HandlerFactory
and add your handler to the $handlers
array
Call the HandlerFactory::register($name)
to register your own Handler at runtime and use it