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

[eluser]mtpultz[/eluser]
2014 Update
The CodeIgniter docs for sharing application resources can be found at:
http://ellislab.com/codeigniter/user-gui...oader.html

It's as easy as including them in application/third_party folder and accessing them using:
Code:
$this->load->add_package_path('path_to_application_folder/third_part/your_package')
#12

[eluser]robert.fulcher[/eluser]
I am reading over this thread and kinda understand what is going on here. I have a situation where I have the same code for many clients but the database is separate. Is there some way to configure the system to use the same code base for all clients and based on the directory they go into.... www.website.com/clienta or www.website.com/clientb the would get the config file for their site. Sharing all the same code just different config files pointing to client specific items such as images and the database settings?

Thanks
#13

[eluser]mtpultz[/eluser]
As it stands using built in application packages within CodeIgniter the code needs to be in the third_party folder of that apps application folder. There doesn't seem to be a way to centralize the code more than that. So "as I understand it" you'd pull down a GIT repository (or similar) into the third_party folder in each application, and that's as good as it gets, but they would both be able to use the same code base, and just have to independently pull down new versions.

Hope that helps, if you figure out something a little more centralized let me know. I was researching this about a week ago and this is the conclusion that I came to based on docs, numerous websites, and stackoverflow.

Cheers
#14

[eluser]Unknown[/eluser]
It doesn't have to be in a third_party folder, that's just what they recommend doing. Note this line in the Loader Class documentation:

$this->load->remove_package_path(APPPATH.'third_party/foo_bar/');

They are explicitly adding a package in APPPATH/third_party, but really that could be any absolute path to the shared resources you want to access.
#15

[eluser]mtpultz[/eluser]
Kewl, thanks I stand corrected Smile




Theme © iAndrew 2016 - Forum software by © MyBB