Welcome Guest, Not a member yet? Register   Sign In
site doesn't load with include path
#1

[eluser]slapyo[/eluser]
I have a lot of sites that use the same /application/models/, /application/helpers/, and /application/libraries/.

I have them all sitting in /opt/www/includes/application/ and I also have /opt/www/includes/system/.

In PHP I have the include path set so that all I have to do is include('system/...') and it will work. But it's not.

In the individual sites root folders they do not have the 3 folders in application and they don't have the system folder. If I add them in, the site works no problem. However, for the sake of having to edit the same file over and over I'd really like to have one central place for them all to be. Should I make symbolic links?

Ideas, suggestions ... anything?
#2

[eluser]Aken[/eluser]
Use Application Packages. http://ellislab.com/codeigniter/user-gui...oader.html
#3

[eluser]slapyo[/eluser]
[quote author="Aken" date="1341352663"]Use Application Packages. http://ellislab.com/codeigniter/user-gui...oader.html[/quote]
Does this work across multiple servers? Can you explain a little more how you set it up?
#4

[eluser]Aken[/eluser]
An application package is a folder with various CI-like subfolders (models, helpers, libraries, etc). Adding the application path tells CI to look for files in these folders as well as in your /application/... and /system/... folders. Read the user guide page for more information, that's why I linked it.

I'm under the assumption that you have multiple CI applications on the same server, all with access to the common /includes/ folder. If you are trying to use one shared folder between multiple servers, that is inadvisable for a bunch of reasons.
#5

[eluser]slapyo[/eluser]
[quote author="Aken" date="1341353765"]An application package is a folder with various CI-like subfolders (models, helpers, libraries, etc). Adding the application path tells CI to look for files in these folders as well as in your /application/... and /system/... folders. Read the user guide page for more information, that's why I linked it.

I'm under the assumption that you have multiple CI applications on the same server, all with access to the common /includes/ folder. If you are trying to use one shared folder between multiple servers, that is inadvisable for a bunch of reasons.[/quote]
Ok cool, I'm gonna check it out now. I was out of the office for a little and on my phone.

I'm not sharing a folder across multiple servers, I have SVN push that folder to all the servers.
#6

[eluser]Aken[/eluser]
Okay, then you just need to make sure to add the application path support to each of your applications. That should be the only change you need to make to every website.
#7

[eluser]slapyo[/eluser]
[quote author="Aken" date="1341355357"]Okay, then you just need to make sure to add the application path support to each of your applications. That should be the only change you need to make to every website.[/quote]

Ok that all seems to be working except that I need to extend the cache drivers to have a memcache driver I wrote. I thought maybe putting the Cache folder in the libraries would work but it doesn't seem to.
#8

[eluser]Aken[/eluser]
Correct. The Cache driver needs to be extended if you wish to implement your own driver. I think you should only need to add your driver's name to the $valid_drivers array. Then you can add the driver itself to your common folder, IE: /includes/libraries/Cache/drivers/Cache_yourdriver.php




Theme © iAndrew 2016 - Forum software by © MyBB