| CARVIEW |
Every repository with this icon (
Every repository with this icon (
| Description: | CakePHP plugin enabling transfer/manipulation/embedding of (media) files in 2300 ways. |
FAQ
The fileinfo or mime_magic extension isn’t available in my environment. Can I still use this plugin?
Yes, but you’ll need a magic.db file. You can either use the file which comes with apache’s mod_mime_magic module (e.g. /etc/apache2/magic) or if you’ve got the Freedesktop Shared MIME-info Database installed a valid file can be found in e.g. /usr/share/mime/magic . Copy the file into a your vendors directory and name it magic.db. Please note that the MIME magic implementation in pure PHP will always be a lot slower then the PHP extensions in C and currently has to be considered experimental.
What is the purpose of storing the file’s hash in the table?
This way it’s possible to check if a file has in some way been modified since a link to it has been stored in the table. E.g. the SyncTask checks the consistency of those links by comparing the hashes stored with the actual hash values of the files (and vice versa).
Why is it recommended to move all media files to a directory below webroot?
Using a directory outside webroot to store media and serve those files through the framework is inefficient. This is because those files are being served through cake+php+apache (using readfile). It’s much faster to let apache serve them.
An excerpt from the Django docs which is more or less applicable:
Django itself doesn’t serve static (media) files, such as images, style sheets, or video. It leaves that job to whichever Web server you choose. [...] standard Web servers, such as Apache and lighttpd, are much more fine-tuned at serving static files than a Web application framework.
Won’t the MediumHelper::embed and ::link methods slow things down? Do those methods search through all my paths?
By using the MediumHelper::embed and ::link methods which in turn utilize MediumHelper::file referencing files in a more complicated directory layout gets a lot easier. the file method will try to make sense of the (fragmented) path you provided by completing that path. It won’t search through all your paths. But you’re right some overhead is involved. This is compensated through caching inside the helper.




