Welcome Guest, Not a member yet? Register   Sign In
Help us to decide
#10

Without going into the details of your particular directory structure, I'm going to state unequivocally that you should always setup your project so that it can be installed with all of the code outside of the public directory.

If you want people to be able to distribute modules which include assets which should be in the public directory, but don't want people to have to manually copy those assets into the public directory, then you should include some sort of library or installer for modules which copies those assets for them.

Bonfire's Assets library has a pair of methods (add_module_css() and add_module_js()) which allow developers to add CSS/JS assets which are stored in their module's assets directory to their views. When the library is preparing to output link/script elements to the page, it checks for and/or builds a cached version of the module's files in /public/assets/cache/ (assuming a default configuration), with the module name added into the file name to prevent name collisions. Since this requires some careful configuration for security reasons (after all, the application has to be able to write to that directory AND it has to be readable by the public), the developer has the option of building the cache him/herself, though it requires a significant understanding of how the files or generated (though you could allow the files to be generated in a development/test environment and migrate them to your production environment).
Reply


Messages In This Thread
Help us to decide - by Blair2004 - 08-10-2015, 01:14 AM
RE: Help us to decide - by ivantcholakov - 08-10-2015, 04:08 AM
RE: Help us to decide - by ivantcholakov - 08-10-2015, 04:13 AM
RE: Help us to decide - by orionstar - 08-10-2015, 04:52 AM
RE: Help us to decide - by Blair2004 - 08-10-2015, 02:26 PM
RE: Help us to decide - by orionstar - 08-11-2015, 05:00 AM
RE: Help us to decide - by jdriddle - 08-10-2015, 02:46 PM
RE: Help us to decide - by Blair2004 - 08-11-2015, 01:35 AM
RE: Help us to decide - by Blair2004 - 08-11-2015, 01:42 AM
RE: Help us to decide - by mwhitney - 08-11-2015, 06:41 AM
RE: Help us to decide - by Blair2004 - 08-11-2015, 08:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB