CodeIgniter Forums
Common folder between projects for extended libraries and helpers - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Common folder between projects for extended libraries and helpers (/thread-50660.html)



Common folder between projects for extended libraries and helpers - El Forum - 04-03-2012

[eluser]Klaurus[/eluser]
I am wondering... There is a way to put all my extended libs and helpers in a shared folder so I can access they from different projects?


Common folder between projects for extended libraries and helpers - El Forum - 04-04-2012

[eluser]Klaurus[/eluser]
Bump!


Common folder between projects for extended libraries and helpers - El Forum - 04-04-2012

[eluser]NotDior[/eluser]
If I'm understanding correctly, yes you can do this. I've got many sites running off of one instance of CI.

Basically you'll want to put your system folder into a location that all of your sites can get access to. From there you'll just change your index.php to refer to your common instance of the system folder . For instance install CI system folder to: /usr/local/share/php/codeIgniter2-1/system/ and refer to that location in your index.php. You can still have your application code in the site directory if you want to keep that seperate. In that instance: /home/USERNAME/codeIgniter/application/config etc etc.

In the Index.php file you'd set $system_folder = "/usr/local/share/php/codeIgniter2-1/system" and you'd set $application_folder = "/home/USERNAME/codeIgniter/application"

Hope that helps.