Welcome Guest, Not a member yet? Register   Sign In
Global Libraries
#1

[eluser]pwfraley[/eluser]
Hi all,

I have a question about developing global Libraries.

I have setup Codigniter with a global CI Installation and have virtual hosts with applications that use the global CI Installation.

Now I have created a Library that is used in all of the Applications. I put this Library in each of the application/libraries folders. Now when I make a change to the library I have to copy it too all the applications. I guess I could use links and link it to all applications, but when I install the apps on a hosting provider I do not have the possibility to create links.

Is it possible to put my library into the system/libraries folder? What do I have to look out for? Should I name my class CI_Mserver instead of Mserver?

Also what if I have a base Application with Base Models and Base Controllers and I want to extend those? Can I somehow create a Baseapp, which I can inherit from in Sub Applications?

Thanx for any ansers
#2

[eluser]pwfraley[/eluser]
Well I spent an hour now reading thru the posts, as far as I understood:

1. I can put my own Library in the system/libraries Folder, but I have to name it MY_Mserver (is that correct)?

2. I still have not found an answer to the model and controller question I posted up there. Can I create a model and a controller folder in the system folder and then use those files as bases for my apps?

Can anyone answer those questions?
#3

[eluser]JanDoToDo[/eluser]
You can put the library in the system folder as CI does a search of each of the library folders to find your function. You only have to rename it with a "MY_" if it is extending an existing CI library. Ive never used Mserver so I dont know if thats your or CI's ...
With Models and Contrllers I belive you should be able to put them in the main system and then in the applications you should be able to extend them using the MY_ and referencing/ instantiating it as the base class.

Hope this helps..
#4

[eluser]JanDoToDo[/eluser]
Though im no expert so might be wrong Smile Smile
#5

[eluser]pwfraley[/eluser]
Thanks. I tried to put it in system library folder and it worked. MServer is my own class it connects to a calculation/statistics server. I use that to get live data from it to display in my app.

I will try the same with the controller and model this evening, but it seems like it should work ...

Again thanks for the reply Smile




Theme © iAndrew 2016 - Forum software by © MyBB