Closed (fixed)
Project:
Drush
Version:
7.x-5.0-rc3
Component:
Make
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
27 Feb 2012 at 07:48 UTC
Updated:
14 Mar 2012 at 22:40 UTC
Jump to comment: Most recent file
I get the following:
Fatal error: Call to undefined function mime_content_type() in /home/vih/drush/commands/make/make.download.inc on line 108
When trying to use my drush make file located at: https://github.com/vih/vih.dk-deploy/blob/master/vih_dk.make
As far as I can tell - the error occurs when trying to dl autopager like this:
libraries[autopager][download][type] = "get"
libraries[autopager][download][url] = "http://jquery-autopager.googlecode.com/files/jquery.autopager-1.0.0.js"
libraries[autopager][directory_name] = "autopager"
libraries[autopager][destination] = "libraries"
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | drush_1458416-11.patch | 4.01 KB | adamdicarlo |
| #11 | drush_1458416-8-11.diff | 2.51 KB | adamdicarlo |
| #8 | drush_1458416.patch | 3.95 KB | adamdicarlo |
Comments
Comment #1
lsolesen commentedSeems that mime_content_type() has been deprecated:
Comment #2
jhedstromThis went in as part of #1447558: Make fails for library archives with no file "extension". Looks like some 5.3 builds of php don't include deprecated functions, so we probably need to also include the fileinfo functionality if
mime_content_type()doesn't exist.Comment #3
lsolesen commentedhm. none are part of a standard dreamhost php 5 build
Comment #4
adamdicarlo commented@Isolesen, to confirm, you're saying that Dreamhost's PHP 5 includes neither the fileinfo module nor the mime_content_type() function?
That's pretty darn lame if true.
@jhedstrom, Since the only reason we need (one of) those functions is to determine if a file is tar, tgz, or zip can we just sniff the binary file header ourselves? It should be pretty easy.
Comment #5
jhedstrom@adamdicarlo, we could do that as a secondary fallback--I envision changing this to use a function called drush_mime_content_type(), and within that do various function_exists checks, so we can start with file info functions, then fallback to mime_content_type, and then lastly attempt to sniff the header ourselves.
Comment #6
lsolesen commented@adamdicarlo - I am pretty sure that neither is included in the build.
@jhedstrom - that seems like a good approach.
Comment #7
moshe weitzman commentedThe `file --mime` command, if available, can also provide this info.
Comment #8
adamdicarlo commentedWhere should drush_mime_content_type() go? Should it be called something else? Its functionality is (at its worst case) limited to detecting only tar, gz/tgz, and zip.
I didn't want to add yet another "if it's available, use it" so I didn't try to add `file --mime`. That said, first time using pack() -- how's that look? Should the code check for endianness / are the fall through switch cases necessary?
Comment #9
adamdicarlo commentedWhoops, header comment is totally wrong about return values. What *should* this return on error?
Comment #10
moshe weitzman commentedLooks fine to me. Will let jhedstrom make final call here.
Comment #11
adamdicarlo commentedUpdated patch with an interdiff. This patch fixes the header comment, removes the case FALSE which is redundant (was left over from older version), always reads the magic bytes in little endian and thus only does the tests in little endian. also contains links to file header magic docs online.
Comment #12
jhedstromCommitted #11. Thanks!