quannda / codeigniter-project-seed
Package to install Multiple Application CodeIgniter3 in one project via Composer with secure folder structure.
This package is not auto-updated.
Last update: 2025-05-11 04:16:02 UTC
README
CodeIgniter Composer Installer
This package installs the offical CodeIgniter (version 3.1.*
) with multiple applications project in secure folder structure via Composer.
Note: If you want to install CodeIgniter4 (under development), see https://github.com/kenjis/codeigniter-composer-installer/tree/4.x.
You can update CodeIgniter system folder to latest version with one command.
Folder Structure
codeigniter/
├── application/frontend
├── application/backend (*)
├── application/api (*)
├── composer.json
├── composer.lock
├── public/
│ ├── .htaccess
│ └── index.php
└── vendor/
└── codeigniter/
└── framework/
└── system/
You can define yours applications by clone then change composer.json with key
{
"name": "Your package name",
"config": {
"apps": {
"backend": {
"source": "application/backend",
"doc_root": "public_html/cpanel"
},
"frontend": {
"source": "application/frontend",
"doc_root": "public_html"
},
"api": {
"source": "application/api",
"doc_root": "public_html/api"
}
}
}
}
Requirements
- PHP 5.3.7 or later
composer
command (See Composer Installation)- Git
How to Use
Install CodeIgniter
$ composer create-project quannda/codeigniter-project-seed codeigniter
Above command installs draft source code structure for project in folder codeigniter, with sample 3 applications config in composer.json. Please take a look and make any change if necessary. Then use
cd codeigniter && composer install
Above command installs public/.htaccess
to remove index.php
in your URL. If you don't need it, please remove it.
And it changes each application/{app_name}/config/config.php
:
$config['composer_autoload'] = FALSE;
↓
$config['composer_autoload'] = realpath(APPPATH . '../vendor/autoload.php');
$config['index_page'] = 'index.php';
↓
$config['index_page'] = '';
Install Translations for System Messages
If you want to install translations for system messages:
$ cd /path/to/codeigniter
$ php bin/install.php translations 3.1.0
Install Third Party Libraries
$ php bin/install.php matches-cli master
$ php bin/install.php hmvc-modules master
$ php bin/install.php modular-extensions-hmvc codeigniter-3.x
$ php bin/install.php ion-auth 2
CodeIgniter3 Filename Checker:
$ php bin/install.php filename-checker master
$ php bin/install.php restserver 2.7.2
Run PHP built-in server (PHP 5.4 or later)
$ cd /path/to/codeigniter
$ bin/server.sh
Update CodeIgniter
$ cd /path/to/codeigniter
$ composer update
You must update files manually if files in application
folder or index.php
change. Check CodeIgniter User Guide.