Skip to content

Handler for simple-uploader #36

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 3 commits into from
May 21, 2018
Merged

Handler for simple-uploader #36

merged 3 commits into from
May 21, 2018

Conversation

dyktek
Copy link
Contributor

@dyktek dyktek commented May 20, 2018

I just added handler for https://github.com/simple-uploader and it's working nice also with https://github.com/simple-uploader/vue-uploader

this is base on ChunksInRequestUploadHandler.php

@pionl
Copy link
Owner

pionl commented May 21, 2018

Sweat! I would have just 2 requests to make it better:

  1. Please rebase the commits into single commit without the .idea related files (you can reset the last commit and force push the new commit)
  2. Change the ChunksInRequestUploadHandler to use const (use static::KEY_CHUNK_NUMBER, etc), then excend the ChunksInRequestUploadHandler in ChunksInRequestSimpleUploadHandler and override the const variables. This should allow using different keys for accessing data from request. Thanks to this logic will be same.

Is it clear what I'm suggesting? :)

@dyktek
Copy link
Contributor Author

dyktek commented May 21, 2018

Done :) https://github.com/dyktek/laravel-chunk-upload/

@pionl
Copy link
Owner

pionl commented May 21, 2018

Nice, unfortunately php 7 tests failed. I think 7.0/5.6 does not support visibility? (7.1 does) ? For me it can be removed.

1) ChunkTests\Handler\DropZoneUploadHandlerTest::testInitWithoutRequestData
ParseError: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE)
/home/travis/build/pionl/laravel-chunk-upload/src/Handler/ChunksInRequestUploadHandler.php:26
/home/travis/build/pionl/laravel-chunk-upload/src/Handler/DropZoneUploadHandler.php:11
/home/travis/build/pionl/laravel-chunk-upload/tests/Handler/DropZoneUploadHandlerTest.php:24
2) ChunkTests\Handler\DropZoneUploadHandlerTest::testCanBeUsedForInvalidRequest
ParseError: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE)
/home/travis/build/pionl/laravel-chunk-upload/src/Handler/ChunksInRequestUploadHandler.php:26
/home/travis/build/pionl/laravel-chunk-upload/src/Handler/DropZoneUploadHandler.php:11
/home/travis/build/pionl/laravel-chunk-upload/tests/Handler/DropZoneUploadHandlerTest.php:38
3) ChunkTests\Handler\DropZoneUploadHandlerTest::testCanBeUsedForInvalidRequestPartDaata
ParseError: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE)
/home/travis/build/pionl/laravel-chunk-upload/src/Handler/ChunksInRequestUploadHandler.php:26
/home/travis/build/pionl/laravel-chunk-upload/src/Handler/DropZoneUploadHandler.php:11
/home/travis/build/pionl/laravel-chunk-upload/tests/Handler/DropZoneUploadHandlerTest.php:47
4) ChunkTests\Handler\DropZoneUploadHandlerTest::testCanBeUsedOnValidRequest
ParseError: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE)
/home/travis/build/pionl/laravel-chunk-upload/src/Handler/ChunksInRequestUploadHandler.php:26
/home/travis/build/pionl/laravel-chunk-upload/src/Handler/DropZoneUploadHandler.php:11
/home/travis/build/pionl/laravel-chunk-upload/tests/Handler/DropZoneUploadHandlerTest.php:58
5) ChunkTests\Handler\DropZoneUploadHandlerTest::testValidChunkRequest
ParseError: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE)
/home/travis/build/pionl/laravel-chunk-upload/src/Handler/ChunksInRequestUploadHandler.php:26
/home/travis/build/pionl/laravel-chunk-upload/src/Handler/DropZoneUploadHandler.php:11
/home/travis/build/pionl/laravel-chunk-upload/tests/Handler/DropZoneUploadHandlerTest.php:68
6) ChunkTests\Handler\DropZoneUploadHandlerTest::testValidChunkFinishRequest
ParseError: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE)
/home/travis/build/pionl/laravel-chunk-upload/src/Handler/ChunksInRequestUploadHandler.php:26
/home/travis/build/pionl/laravel-chunk-upload/src/Handler/DropZoneUploadHandler.php:11
/home/travis/build/pionl/laravel-chunk-upload/tests/Handler/DropZoneUploadHandlerTest.php:86

@dyktek
Copy link
Contributor Author

dyktek commented May 21, 2018

done :)

* Key for number of sending chunk
* @static string
*/
protected const KEY_CHUNK_NUMBER = 'chunkNumber';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove please too :)

* Key for number of all chunks
* @static string
*/
protected const KEY_ALL_CHUNKS = 'totalChunks';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove please too :)

@pionl
Copy link
Owner

pionl commented May 21, 2018

Thanks, last request (thank you for the contribution, it's awesome!), will merge today.

@dyktek
Copy link
Contributor Author

dyktek commented May 21, 2018

done

@pionl pionl merged commit 7c02e82 into pionl:master May 21, 2018
@pionl
Copy link
Owner

pionl commented May 21, 2018

Thank you @dyktek 👍 Merged. If you have any code example I can update the WIKI. 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants