CodeIgniter Forums
Runtime mimes.php generation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19)
+--- Thread: Runtime mimes.php generation (/showthread.php?tid=66399)



Runtime mimes.php generation - infinity0n3 - 10-19-2016

Is there a way to change mimes.php during run-time so that it can accompany run-time allowed_types generation?

It would be preferred to do this using a helper from application.
However $CI =& get_instance(); does not work in mimes.php


RE: Runtime mimes.php generation - Narf - 10-20-2016

Yes, you can rewrite the file before loading it, but I still (after the GitHub conversations) don't understand why you want to do this at runtime instead of having a proper configuration from the start.


RE: Runtime mimes.php generation - infinity0n3 - 10-20-2016

We are using CI as a base for FABUI (FABtotum 3D printer on-board web interface).

New plugin system has the ability to extend supported file types. As the whole system is running on a custom build and optimized linux,
there are strict policies which parts of the filesystem are RO/RW.

- The first reason or going for a runtime/on-the-fly generation is that we don't know at this point what file type support will be added by new plugins (user created).
- Second reason is that that the web files are in the read-only section of the filesystem and if modified by overlay mechanism it would create problems for updates. So is best if no files are modified with a new plugin being activated/deactivated.

The mimes.php could be regenerated "physically" every time a plugins is activate/deactivated but I would really like to avoid that as it would cause other problems.


RE: Runtime mimes.php generation - Narf - 10-20-2016

Types you allow is not the same thing as types you know ...