Welcome Guest, Not a member yet? Register   Sign In
Modularization question and extension choice
#1

[eluser]Unknown[/eluser]
I've now written several CI applications and have found that I am using the same external libraries in many of them. So what I would like to do is to use one of the modularization "extensions" to start including libraries like Template and Ion Auth when I need them.

Now this is no problem, at least for any given application. But what I would really like to do is to set up my development environment with just one set of files for each of them. So I'd do something like:

root
-codeigniter
--system
--common_modules
---module1
---module2
...
--common_libraries
---library1
---library2
...
--common_helpers
---helper1
---helper2
...


-site1
--application
---modules
----app_module1
...
--assets
...

Any given site could have one or more of the commonly used modules/libraries/helpers and one or more modules/libraries/helpers that are specific to that site. Each site would also have its own version of any config or lang files needed. And, finally, each site could conceivably have its own version(s) of the modules' view files.

Using the Template library like this would only (probably) mean that only the actual library file would need to exist in the "common_libraries" directory. The rest would be in the "proper" places in the site. But Ion Auth would probably use at least the library and model and language files, if not also the controller and possibly the config. The view files would almost always be in the site's application/views directory. (Sites needing a custom Ion Auth controller or model could merely extend the default version.)

When a site is ready for upload or svn, the common modules, libraries and helpers would be placed in their normal positions in the site's application directory. Ideally, CI would just find what's needed without re-coding any paths, but there could be a production/development "switch" if necessary.

So, my question: is this kind of thing possible? And which would work better for this, Modular CI or Modular Extensions? Being able to use common assets (like JavaScript) would also be nice!)




Theme © iAndrew 2016 - Forum software by © MyBB