quannda/codeigniter-project-seed

Package to install Multiple Application CodeIgniter3 in one project via Composer with secure folder structure.

v0.1.4 2017-04-23 08:07 UTC

This package is not auto-updated.

Last update: 2024-04-13 22:53:19 UTC


README

CodeIgniter Composer Installer

Latest Stable Version Total Downloads Latest Unstable Version License

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

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

Codeigniter Matches CLI:

$ php bin/install.php matches-cli master

CodeIgniter HMVC Modules:

$ php bin/install.php hmvc-modules master

Modular Extensions - HMVC:

$ php bin/install.php modular-extensions-hmvc codeigniter-3.x

Ion Auth:

$ php bin/install.php ion-auth 2

CodeIgniter3 Filename Checker:

$ php bin/install.php filename-checker master

CodeIgniter Rest Server:

$ 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.

Reference

Related Projects for CodeIgniter 3.x