Skip to content
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

Chunked files won't reassemble due to getInnerIterator call #41

Closed
sheeep opened this issue Aug 10, 2013 · 5 comments
Closed

Chunked files won't reassemble due to getInnerIterator call #41

sheeep opened this issue Aug 10, 2013 · 5 comments
Labels

Comments

@sheeep
Copy link
Contributor

sheeep commented Aug 10, 2013

@p365labs:

Hi, I'm testing the bundle with Symfony 2.1.6 and the last bundle tag version 0.9.7 with bluimp as frontend, but I have I problem with chunks upload.
The problem is that the bundle don't re-assemble the file leaving the chunks not assembled. I've tried to debug a bit and I've noticed that the problem is $iterator = $chunks->getIterator()->getInnerIterator(); in ChunkManager.php.
If I remove the getInnerIterator() leaving only getIterator() all works fine : the file is correctly assembled and the chunks removed. Am I doing something wrong ?

original: a comment in #21

@sheeep
Copy link
Contributor Author

sheeep commented Aug 10, 2013

Hi @p365labs

I've copied your problem to a new issue, mostly because I think this could be a potential bug.
May I ask what is your current PHP version?

I'll take a look at this issue asap. :)

@p365labs
Copy link

this is my PHP version on Ubuntu 12.04

PHP 5.3.10-1ubuntu3.7 with Suhosin-Patch (cli) (built: Jul 15 2013 18:10:56)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans

@sheeep
Copy link
Contributor Author

sheeep commented Aug 11, 2013

Hmm. I have a little problem testing this one. Mainly because I'm failing at installing a Symfony2 version 2.1.6. Is there a reason you're working on a 8 month old version of it? According to the Release Process, version 2.1 has reached End of Maintenance.

  [Composer\Downloader\TransportException]                                                                                                 
  The "https://api.github.com/repos/sensio/SensioDistributionBundle/zipball/v2.1.5" file could not be downloaded (HTTP/1.1 404 Not Found) 

I'd consider updating to 2.3. But anyway, maybe it will clarify sooner as expected. Could you post me the response after adding the following to ChunkManager line 53.

var_dump(get_class($chunks->getIterator()));
var_dump(get_class($chunks->getIterator()->getInnerIterator()));
die();

The expected output should be something like this:

string(52) "Symfony\Component\Finder\Iterator\PathFilterIterator"
string(13) "ArrayIterator"

Strange is that you don't end up getting an exception. This is an indicator that $iterator still contains an innerIterator. To pile up the strangeness, it seems that $chunk->getIterator() is iterateable in your project and this even though I can't find any changes to the iterators in the Finder.

This one will lead to a dependency change, if the reason of it all lies in the version of Symfony2.

@p365labs
Copy link

Ehy probably you were right, these are the debug infos you requested :
chunks --> Symfony\Component\Finder\Finder
getIterator --> ArrayIterator

If you check the Symfony api online, you'll see that in SY 2.1 PathFilterIterator is not present, it's implemented from SY 2.2. The difference is taht getIterator() returns an ArrayIterator...
Considering we've planned to SY 2.3 as soon as possible I'm not considering this as a great problem, maybe I could suggest you to set the minimum bundle requirement to Symfony 2.2 and not 2.1.

how does it sound ?

@p365labs
Copy link

Ok I've tested it with "symfony/symfony": "2.3.1",
and it works fine

Thanks
Federico

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

No branches or pull requests

2 participants