• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
few applications on the same server

Hello every body,

I used Code Igniter for a few applications on a server. Each application has its own codeigniter folder.

But I am not sure that the best practice in this case.

That I want is :
- some controllers and other ressources like pictures or js code are common for all app
- each app have its own config files (maybe on this point, I can match)

I think organization is better because controllers, models and views are not mixed in same folders but the code of codeigniter is replicated !

Have you some advices or good practices ?

In advance, I thank you.

"I used Code Igniter for a few applications on a server. Each application has its own codeigniter folder."

If these applications are totally independent by their purpose, leave them as they are.

I was fighting with similar situation for few month. I needed these situations.

1. clean codeigniter system folder where to upgrade CI3 if needed
2. application folder where to put controllers/models/views and all logic that is typical for exactly this one application
3. application folder where put "my custom libraries" wich I use on every application I write.
4. composer vendor (against my will, because I don't like such utilities. But I had to accept, that I need it. Smile )

I was inspired by kenji solution and by his folder structure https://packagist.org/packages/kenjis/co...-installer but it still wasn't just what I was needed. Because everything in vendor directory is namespaced and has psr-0 or psr-4 autoload capability. CodeIgniter 3 is not yet namespaced. And I needed my custom folder where to put my custom non-namespaced libraries used in my all applications.

Now I use this directory structure (showin just important directories):

- codeigniter - git submodule (codeigniter system directory leavin untouched at all cost)
- application (all logic models and views typical for this one and only app)
- custom - git submodule (THIS is folder where to store mentioned my universal used libraries (i'm using ci3 "packages" logic)
- vendor - git .ignored (typical composer vendor directory)

- public (document root for application. it contains all public accessible files)
-- js
-- css
-- img
-- vendor

All of this is something like my personal sandbox. I keep it under git. And when I update "custom" or "codeigniter", I don't loose the clue because they are used as submodules of git and git tells me about update in every my project. May be, splitting "custom" and "codeigniter" together to one submodule would be good idea, but I don' know.

Hope this is helpfull.
If somebody means this is no good-practice, write.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.