Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1683 closed Task (fixed)

Can we use Apache 2's magic file instead?

Reported by: vipsoft Owned by:
Priority: normal Milestone: Piwik 1.1
Component: Core Keywords:
Cc: Sensitive: no

Description

I just noticed the gnuwin32/file/magic is over a half meg and most of the entries don't have associated mime types. Can we use Apache's magic file? (around 30K)

Otherwise, we should drop the finfo feature in Piwik::serveStaticFile() and require tht content type be set explicitly by the caller.

Change History (3)

comment:1 Changed 4 years ago by vipsoft (robocoder)

Observations:

  • user reports that fileinfo PECL extension doesn't work with the newer gnuwin32 magic file
  • with Apache's magic file, I have to use FILEINFO_CONTINUE instead of FILENFO_MIEM, otherwise the result is always "application/octet-stream; charset=binary"

comment:2 Changed 4 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(In [3109]) fixes #1683 - removed the magic database to reduce bloat; content type is a mandatory parameter to Piwik::serveStaticFile()

Also:

  • small changes for coding style and phpdocs
  • fix unit tests when piwik not installed in web root directory
Note: See TracTickets for help on using tickets.