sync svn r24702 - support application/x-zip in Validator\File\IsCompressed #4431

Closed
wants to merge 1 commit into
from

2 participants

@sasezaki

This is a sync of svn r24702.
for support application/x-zip

@see (commit-log)
https://bitbucket.org/sasezaki/mirror-zf1-standard-trunk-libraray-validate-dir/commits/deab989ef3728529ff4f0f35aba7ca6498643523
https://bitbucket.org/sasezaki/mirror-zf1-standard-trunk-tests-validate-dir/commits/c11495d2a6d3f191694820f9a9b6b7938a062fa8

original commit is using mime_content_type() function (yeah, it is deprecated) , so should be attention before merge this.

@sasezaki

uh, when I do google about "application/x-zip", "application/x-zip-compressed" is hit.

@weierophinney weierophinney was assigned May 6, 2013
@weierophinney
Zend Framework member

This is failing on, specifically, 5.3.3. Personally, I get issues for each of data sets 0, 1, 3, and 5. The same tests pass on 5.3.latest and 5.4.latest, however, which indicates to me an issue with ext/fileinfo. As such, we likely need some version-sniffing to make this work across versions. Are you able/willing to attempt this, @sasezaki ?

@weierophinney weierophinney added a commit to weierophinney/zendframework that referenced this pull request May 6, 2013
@weierophinney weierophinney [#4431] Refactored tests slightly
- Was observing test failures due to calling markTestSkipped() inside a
  data provider.
- Created new skipIfBuggyMimeContentType() method to call to skip a test
  if mime_content_type() returns buggy information for zip files
b96418d
@weierophinney weierophinney added a commit to weierophinney/zendframework that referenced this pull request May 6, 2013
@weierophinney weierophinney [#4431] Better mime_content_type behavior
- Only skip if we're dealing with a zip type in the first place.
a149b1b
@sasezaki

kinda strange. My environment ( Ubuntu + php 5.3.3 built with configure no option) pass IsCompressedTestphp.

$ ~/php-src/php-5.3.3/sapi/cli/php -d include_path=/usr/share/php /usr/bin/phpunit -c tests/phpunit.xml.dist tests/ZendTest/Validator/File/IsCompressedTest.php

PHPUnit 3.7.14 by Sebastian Bergmann.

Configuration read from /home/sasezaki/zf2/tests/phpunit.xml.dist

.....................

Time: 5 seconds, Memory: 31.50Mb

OK (21 tests, 40 assertions)

when using PHP 5.3.3 and other OS (or magic.mime) - composition, would not work??

@weierophinney weierophinney added a commit that referenced this pull request May 8, 2013
@weierophinney weierophinney [#4431] Remove usage of mime_content_type
- Deprecated since 5.3.0, and fileinfo is enabled by default in vanilla PHP
  builds. It makes no sense to fallback to it, when finfo does a much better
  job.
67ef807
@weierophinney weierophinney added a commit that closed this pull request May 8, 2013
@weierophinney weierophinney Merge branch 'hotfix/4431'
Close #4431
acdde72
@weierophinney weierophinney added a commit that referenced this pull request May 8, 2013
@weierophinney weierophinney Merge branch 'hotfix/4431' into develop
Forward port #4431
a72f163
@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@weierophinney weierophinney [#4431] Refactored tests slightly
- Was observing test failures due to calling markTestSkipped() inside a
  data provider.
- Created new skipIfBuggyMimeContentType() method to call to skip a test
  if mime_content_type() returns buggy information for zip files
cf30564
@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@weierophinney weierophinney [#4431] Better mime_content_type behavior
- Only skip if we're dealing with a zip type in the first place.
f571948
@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@weierophinney weierophinney [#4431] Remove usage of mime_content_type
- Deprecated since 5.3.0, and fileinfo is enabled by default in vanilla PHP
  builds. It makes no sense to fallback to it, when finfo does a much better
  job.
e06eb7b
@ghost Unknown pushed a commit that referenced this pull request Jul 14, 2013
@weierophinney weierophinney Merge branch 'hotfix/4431'
Close #4431
748a7a5
@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge pull request zendframework/zendframework#4431 from sasezaki/val…
…idator_x_zip

sync svn r24702 - support application/x-zip in Validator\File\IsCompressed
575de20
@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@weierophinney weierophinney [zendframework/zendframework#4431] Refactored tests slightly
- Was observing test failures due to calling markTestSkipped() inside a
  data provider.
- Created new skipIfBuggyMimeContentType() method to call to skip a test
  if mime_content_type() returns buggy information for zip files
d942583
@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@weierophinney weierophinney [zendframework/zendframework#4431] Better mime_content_type behavior
- Only skip if we're dealing with a zip type in the first place.
42f9516
@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@weierophinney weierophinney [zendframework/zendframework#4431] Remove usage of mime_content_type
- Deprecated since 5.3.0, and fileinfo is enabled by default in vanilla PHP
  builds. It makes no sense to fallback to it, when finfo does a much better
  job.
0a19046
@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/4431' 10b9b3c
@weierophinney weierophinney added a commit to zendframework/zend-validator that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/4431' into develop 6d4097d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment