Welcome Guest, Not a member yet? Register   Sign In
Making it modular
#1

[eluser]bpat1434[/eluser]
I'm not a heavy user in any way shape or form; however, I have used the ZF a lot. One thing I can say I love about ZF is my ability to take the framework, put it inside a central folder (like /usr/share/php/frameworks/Zend) and then have 150 different sites use "include('Zend/*.php');" to include the proper file.

One thing that is dissuading me from using CI is the inability for me to separate the actual libraries from the application code. It seems there is no one central unifying folder structure, just a bunch of folders at web-root level.

So is it possible (or has anyone already) modified CI so that /system/codeigniter, /system/database, /system/helpers, /system/language, /system/libraries, /system/plugins, /system/scaffolding folders have been moved to a common directory?

This is the one thing ZF has over CI that I absolutely love. Are there any plans to maybe move CI this way so that you can still keep your typical application folder structure, but your library is more separate?
#2

[eluser]Phil Sturgeon[/eluser]
CI can do this easily enough, no hacking required.

In your index.php just set some paths:

Code:
/*
|---------------------------------------------------------------
| SYSTEM FOLDER NAME
|---------------------------------------------------------------
|
| This variable must contain the name of your "system" folder.
| Include the path if the folder is not in the same  directory
| as this file.
|
| NO TRAILING SLASH!
|
*/
    $system_folder = "/usr/share/php/frameworks/codeigniter";

/*
|---------------------------------------------------------------
| APPLICATION FOLDER NAME
|---------------------------------------------------------------
|
| If you want this front controller to use a different "application"
| folder then the default one you can set its name here. The folder
| can also be renamed or relocated anywhere on your server.
| For more info please see the user guide:
| http://ellislab.com/codeigniter/user-guide/general/managing_apps.html
|
|
| NO TRAILING SLASH!
|
*/
    $application_folder = "/usr/sitename/home/public_html/";

or something along those lines.
#3

[eluser]bpat1434[/eluser]
Ah, I see. So would I just put the entire "system" folder there, and then each site would have to recreate their own "system" folder with controllers, views, etc. subfolders?
#4

[eluser]Phil Sturgeon[/eluser]
Nope, system and application are two very similar folders, but not the same. Rename system to codeigniter and put it wherever you like.

Then no site will need a system folder as long as they use those settings in their index.php

All your libraries (that you dont want shared), controllers and models, etc go into application folder, which in this example is your new sites public_html.
#5

[eluser]bpat1434[/eluser]
Okay, I guess I got thrown off because application itself is under the system folder. But okay, thanks for the information. Now I can start playing around with it Smile




Theme © iAndrew 2016 - Forum software by © MyBB