Welcome Guest, Not a member yet? Register   Sign In
Multiple websites running from once application core

I need to create PHP application that will have same core for multiple clients.
Every client has his own folder ( subdomain ) where is his index.php file. Next to the index.php file in same folder is user specified config file for that client.
Every client has his own database.
Here is picture of how I imagine it.

[Image: shx8.png]

As you can see, CodeIgniter files are not in root directory. They are inside application/engine.

I have one class named Engine.php inside application folder. I want to make it simple to run from that file.

My clients will run their applications from their own folders
clients/city/user_1/index.php should look like this.

include "../../../Engine.php";
$app = new Engine();

and have some more user specified configs ( like database name and user/pass ).

I have tried this, but when I do it like this, I have to change path to the system and application folder in CI index.php. After that I get errors from files in core libraries.

Is this even possible and how to "pack" ( wrap ) my CI application in other class that I can call in different folders and run application from there?

There are maybe answers on google, but I have no idea what even to search for this help.

I have seen user guide, but there only core is shared, and every application has own files.
In my case, every user has just different database, and maybe 2-3 files. Everything else is complete same. Atm I have 10 copies of same files on server, and every update I have to copy on 10 spots.

Haven't actually tried this, but you should only need to change two lines in your index.php files:

$system_path = '../system';


$application_folder = '../application';

So, you set these back to where your core files are. If you look at these and read the notes with them, should be able to work through it.

Tried this. After that, I get many errors in library files in core folder.

Try using a full path

I think I have explained it more detailed here:

[quote author="CroNiX" date="1382921121"]Try using a full path[/quote]

I do not get errors for including files, I get erros like

Fatal error: Call to a member function item() on a non-object in C:\wamp\www\projectX\application\engine\system\core\Utf8.php on line 47


Fatal error: Call to a member function elapsed_time() on a non-object in C:\wamp\www\projectX\application\engine\system\core\Output.php on line 360

Theme © iAndrew 2016 - Forum software by © MyBB