Welcome Guest, Not a member yet? Register   Sign In
Global and Local application dir
#1

[eluser]dafke[/eluser]
Hey guys,

I've just started out with CI, and it looks very very promising.

Have a question though. I'd like to use one CI-installation for all sites/applications, which is no problem at all with CI. However, I also want a global and local application dir. The reason is that I'm going to develop some global modules/controllers, which can be used by all sites/application. Each application will also have it's "private" (local) controllers.

I was hoping to have a dir structure like this :

/home/CI (codeigniter installation dir)
/home/CI/application (the global application dir)
/home/site1/www (site1 www dir)
/home/site1/application (the local application dir)
/home/site2/www (site2 www dir)
/home/site2/application (another local application dir)

So, if possible, CI would look first in the local application dir, if the module is not found, look in global application dir. Is this possible with CI without extending it?

Thanks,
David
#2

[eluser]xwero[/eluser]
if by extending you mean changing the core files then the answer is yes.Check out the HMVC library.
#3

[eluser]dafke[/eluser]
Will do! Thanks for the quick reply xwero. Smile
#4

[eluser]dafke[/eluser]
If I'm correct I need to organize my dir structure with HMVC as follows :

/home/CI (codeigniter installation dir)
/home/CI/application (the global application dir)
/home/site1/www (site1 www dir)
/home/CI/application/modules/site1 (the local application dir)
/home/site2/www (site2 www dir)
/home/CI/application/modules/site2 (another local application dir)

Could you confirm this?

The reason I want the seperation is this : 95% of the sites/applications I develop are hosted on our own servers. Sometimes a client has his own server, in this case I'd copy the clients local application dir along with the global application dir. In the above structure this is a bit more difficult, copy the full structure first and then remove the other local application dirs.




Theme © iAndrew 2016 - Forum software by © MyBB