liuggio / ExcelBundle

Excel integration in Symfony2 thanks to https://github.com/PHPOffice/PHPExcel library
www.welcometothebundle.com
MIT License
369 stars 142 forks source link

Added createReader() factory function and tests. #111

Closed vctls closed 7 years ago

vctls commented 7 years ago

also added necessary routing, and fixed a typo.

vctls commented 7 years ago

Travis is stopping with the following error: The command "wget http://cs.sensiolabs.org/get/php-cs-fixer.phar" failed and exited with 8 during . I must have missed something...

vctls commented 7 years ago

Well, actually, that page does 404.

liuggio commented 7 years ago

@vctls thanks a lot!!! (i removed that now :) )

vctls commented 7 years ago

Travis is still failing two jobs, though. This part seems to be the problem, for both errors:

// chack that an empty temporary file cannot be read
$someFile = tmpfile();
$cannotread = $reader->canRead(stream_get_meta_data($someFile)['uri']);
fclose($someFile);

Testing the canRead() method might not be absolutely vital… (also there's a typo in my comment)

liuggio commented 7 years ago

this fail only on 5.3 version ...

vctls commented 7 years ago

and hhvm, too. For php 5.3, the problem is the array syntax. I should have written something like this:

$metadata = stream_get_meta_data($someFile);
$cannotread = $reader->canRead($metadata ['uri']);

And with hhmv, there's an issue with tmpfiles not having an uri: https://github.com/facebook/hhvm/issues/2336 So I should have used tmpnam() instead.

Want me to fix it?

liuggio commented 7 years ago

thanks a lot @vctls we shoud remove from travis the hhvm

vctls commented 7 years ago

Fixed: #112 I should have waited for Travis to finish the build on my previous commit to begin with.