Welcome Guest, Not a member yet? Register   Sign In
Creating a new "shared" folder for models and libraries
#9

[eluser]steward[/eluser]
Thanks for posting that Phil.

An extended loader for CI multi-apps is essential.

If you are able to modify php.ini, consider the "include_path" setting as an alternative to symlinks.

I wrote a generic script that looks at the HTTP_HOST to see what the current site is, and then sets up a few global variables and functions, so any script knows where it is, eg:

site_path() '/home/mysite/path', '/home/myothersite/path', etc
site_home() 'mysite.com', 'myothersite.com', etc
site_domain() 'com', 'dev', etc
site_subdomain() 'travel', 'forums', etc

Since this script is on the include path, I can use it anywhere.
It starts by overriding a few config variables, so eg CI site_url() works as expected.

Then I took the opposite approach, putting the sites further down the folder tree:

/home/CodeIgnitor_1_7_1
/home/domains
/home/domains/mysite
/home/domains/myothersite
/home/app
/home/app/controllers/
/home/app/controllers/mysite
/home/app/controllers/myothersite
/home/app/views/
/home/app/views/mysite
/home/app/views/myothersite

In my case the sites are closely related, and share many views, models etc. They all share the same system and application folders.

I still long for a more "zend-like" approach to loading models, so I always have base functionality but can extend any give site/class as required.


Messages In This Thread
Creating a new "shared" folder for models and libraries - by El Forum - 11-27-2009, 02:45 AM
Creating a new "shared" folder for models and libraries - by El Forum - 11-27-2009, 03:32 AM
Creating a new "shared" folder for models and libraries - by El Forum - 12-20-2009, 02:49 AM
Creating a new "shared" folder for models and libraries - by El Forum - 12-21-2009, 08:36 AM
Creating a new "shared" folder for models and libraries - by El Forum - 12-21-2009, 01:21 PM
Creating a new "shared" folder for models and libraries - by El Forum - 12-24-2009, 04:46 AM
Creating a new "shared" folder for models and libraries - by El Forum - 01-01-2010, 02:26 PM
Creating a new "shared" folder for models and libraries - by El Forum - 01-03-2010, 09:02 AM
Creating a new "shared" folder for models and libraries - by El Forum - 02-18-2010, 10:00 AM
Creating a new "shared" folder for models and libraries - by El Forum - 09-24-2010, 06:53 AM
Creating a new "shared" folder for models and libraries - by El Forum - 07-30-2014, 01:29 PM
Creating a new "shared" folder for models and libraries - by El Forum - 08-04-2014, 08:50 AM
Creating a new "shared" folder for models and libraries - by El Forum - 08-04-2014, 09:35 AM
Creating a new "shared" folder for models and libraries - by El Forum - 08-27-2014, 10:25 AM
Creating a new "shared" folder for models and libraries - by El Forum - 08-29-2014, 09:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB