Codeigniter may be configured to run more than one project without duplicating CI core files.
It's possible by splitting CI Application side. For example let's take project of website, which contains front-end
and back-end
Content Management System (CMS) applications.
In this case CI folder structure will be like:
├── Codeigniter
│ ├── applications
│ │ ├─ front-end
│ │ │ ├── views
│ │ │ ├── models
│ │ │ ├── controllers
│ │ │ ├── config
│ │ │ └── ...
│ │ ├─ back-end
│ │ │ ├── views
│ │ │ ├── models
│ │ │ ├── controllers
│ │ │ ├── config
│ │ │ └── ...
│ │ │
│ ├── system
│ │ ├── core
│ │ ├── database
│ │ ├── helpers
│ │ └── ...
│ │
│ ├── index.php
└ └── backend.php
In applications
folder we created two folders: front-end
and back-end
and copied all default content of applications
under these two folders.
Also we duplicated index.php
file under root folder as backend.php
Next is to configure CI
to work with this two instances of application.
Open index.php and backend.php files and update application_folder
confg:
//index.php
$application_folder = 'applications/front-end';
//backend.php
$application_folder = 'applications/back-end';
After configuration above, CI is ready to run two applications under one CI system:
Request on
example.com/Codeigniter/index.php
will openfront-end
app
Request on
example.com/Codeigniter/backend.php
will openback-end
app