Welcome Guest, Not a member yet? Register   Sign In
Multiple applications, shared models/libraries/views
#1

[eluser]avanwieringen[/eluser]
I finally subscribed to this forum, after reading a lot Smile

I recently (2 months ago) started learning the CodeIgniter framework and I think it is really awesome. I have 5 years of experience as a self-taught PHP-developer. As a test case I rebuilt the custom-made CMS from my work to CodeIgniter in simply 2 full working days, in the process implementing the Zend_ACL. This convinced me and my boss to transfer everything we have in websites to CodeIgniter. This is great, since it allows me to rewrite and optimize a lot of code that is really old or inefficient and in the process document it, since I will be leaving there in 1 year.

However, I have trouble to work out the basic setup and don't want to be faced with double work, double updating of documents etc.

Here is our setup:
Code:
- main website
  * www.company.nl
  * www.company.co.uk
  * in the future maybe others
- online survey system
  * www.company.nl/enquetes (enquetes = surveys in dutch)
  * www.company.co.uk/surveys (in the future possibly, but this could be simply a routes.php trick)
  * implements ACL
  * uses main website views
- customer portal
  * portal.company.nl
  * implements ACL
  * uses main website views
- project websites
  * project.company.nl
  * implements ACL
- backend for everything (website, surveys, portals, project websites)
  * admin.company.nl
  * implements ACL
  * needs the content-models / survey-models of the website / project / pwebsites etc

As you can see, everything has more or less something in common with each other. And here is my problem.

The ACL is easily solvable by putting it in the CodeIgniter systems folder making it accessible for all other applications. This can also be done with other shared libraries. However, for models and views this does not work. As far as I know CodeIgniter has no need to search the systems folder for models and views. And that means that I have to write several models and views that do essentially the same, which is not optimal.

In fact I have 4 different applications and 1 CodeIgniter base:
Code:
- applications
  |- website
     |- surveys
  |- customer
  |- project
  |- backend

- system
  |- libraries
     |- shared  
        |- ACL

The ACL-part is solved this way. But the others not.

The other thing I thought of was making 2 applications and using 1 system as follows:
Code:
- applications
  |- website
     |- main website
     |- surveys
     |- portal
     |- backend
  |- project

- system
  |- libraries
     |- shared  
        |- ACL

But this way it is hard for the backend to obtain the project-models and libraries. Which I want.

The last option was to put everything under 1 application but that way project-website, which is really completely different from everything else and has in fact little to do with it is contained in one application together with all others, while its in fact another application. I don't know if that's optimal for the future. And I dont know if its easy to use project.company.nl while it's in fact www.company.nl/project. The only connection between the project website and the rest is that the ACL defines which project-website-parts people can see.

Has anyone any tips? I know this is a big chunk of text, but I don't know the best solution. Smile


Messages In This Thread
Multiple applications, shared models/libraries/views - by El Forum - 05-16-2009, 06:30 AM
Multiple applications, shared models/libraries/views - by El Forum - 05-16-2009, 06:43 AM
Multiple applications, shared models/libraries/views - by El Forum - 05-16-2009, 06:45 AM
Multiple applications, shared models/libraries/views - by El Forum - 05-16-2009, 06:50 AM
Multiple applications, shared models/libraries/views - by El Forum - 05-16-2009, 06:54 AM
Multiple applications, shared models/libraries/views - by El Forum - 05-16-2009, 07:09 AM
Multiple applications, shared models/libraries/views - by El Forum - 05-16-2009, 12:10 PM
Multiple applications, shared models/libraries/views - by El Forum - 05-16-2009, 12:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB