{"id":15046366,"url":"https://github.com/nguyenanhung/codeigniter-framework","last_synced_at":"2025-08-22T13:04:59.325Z","repository":{"id":37969060,"uuid":"318696601","full_name":"nguyenanhung/codeigniter-framework","owner":"nguyenanhung","description":"CodeIgniter Framework Version 3 - Vendor Packages build - Maintain by @nguyenanhung","archived":false,"fork":false,"pushed_at":"2025-03-14T18:33:46.000Z","size":1581,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-19T14:20:37.429Z","etag":null,"topics":["codeigniter","codeigniter-hmvc","codeigniter-library","codeigniter-skeleton","codeigniter-starterkit","codeigniter3","php"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/nguyenanhung/codeigniter-framework","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nguyenanhung.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-05T03:55:42.000Z","updated_at":"2025-05-25T05:16:44.000Z","dependencies_parsed_at":"2024-03-14T18:34:16.089Z","dependency_job_id":"3795ce46-bd1b-468d-93ec-b47fac801f39","html_url":"https://github.com/nguyenanhung/codeigniter-framework","commit_stats":{"total_commits":151,"total_committers":2,"mean_commits":75.5,"dds":"0.0066225165562914245","last_synced_commit":"5af7cd9380325a1b2137ccd9e03898de96597865"},"previous_names":[],"tags_count":126,"template":false,"template_full_name":null,"purl":"pkg:github/nguyenanhung/codeigniter-framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenanhung%2Fcodeigniter-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenanhung%2Fcodeigniter-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenanhung%2Fcodeigniter-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenanhung%2Fcodeigniter-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nguyenanhung","download_url":"https://codeload.github.com/nguyenanhung/codeigniter-framework/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nguyenanhung%2Fcodeigniter-framework/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271643468,"owners_count":24795440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codeigniter","codeigniter-hmvc","codeigniter-library","codeigniter-skeleton","codeigniter-starterkit","codeigniter3","php"],"created_at":"2024-09-24T20:53:01.888Z","updated_at":"2025-08-22T13:04:59.286Z","avatar_url":"https://github.com/nguyenanhung.png","language":"PHP","readme":"# CodeIgniter v3.2.x - vendor packages build\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/nguyenanhung/codeigniter-framework.svg?style=flat-square)](https://packagist.org/packages/nguyenanhung/codeigniter-framework)\n[![Total Downloads](https://img.shields.io/packagist/dt/nguyenanhung/codeigniter-framework.svg?style=flat-square)](https://packagist.org/packages/nguyenanhung/codeigniter-framework)\n[![Daily Downloads](https://img.shields.io/packagist/dd/nguyenanhung/codeigniter-framework.svg?style=flat-square)](https://packagist.org/packages/nguyenanhung/codeigniter-framework)\n[![Monthly Downloads](https://img.shields.io/packagist/dm/nguyenanhung/codeigniter-framework.svg?style=flat-square)](https://packagist.org/packages/nguyenanhung/codeigniter-framework)\n[![License](https://img.shields.io/packagist/l/nguyenanhung/codeigniter-framework.svg?style=flat-square)](https://packagist.org/packages/nguyenanhung/codeigniter-framework)\n[![PHP Version Require](https://img.shields.io/packagist/dependency-v/nguyenanhung/codeigniter-framework/php)](https://packagist.org/packages/nguyenanhung/codeigniter-framework)\n\nRepackaged version of CodeIgniter's system framework, compatible with Composer and PHP 7, PHP 8\n\nSince version `v3.2.0` - the framework is fully compatible with PHP 8.2\n\nThis package is constantly updated with new features from the original CodeIgniter3 branch. So it is always\nupdated with bug fixes and added new features\n---\n\n## Main features\n\nAdded some extension libraries, related helpers\n\n- [x] Base Controllers with many available protected methods\n- [x] Support HMVC model\n- [x] Support RESTful Web Service\n- [x] Support Queue Worker\n- [x] Support MongoDB database\n- [x] Support Elasticsearch: Use third party packages `\"elasticsearch/elasticsearch\": \"^8.0 || ^7.0 || ^6.0 || ^5.0\"`\n- [x] Support Base Model class with some basic functions enough for SQL\n- [x] Support ORM Model class, providing a simpler and easier method to query\n- [x] Support Output Response on CLI interface via function `ResponseOutput::writeLn($message)`\n- [x] Added `StatusCodes` class to declare standard HTTP codes (from Symfony framework),\n  For example: `StatusCodes::HTTP_OK`. For more details, please refer to class `StatusCodes`\n- [x] Add many useful helpers with the built-in package `nguyenanhung/codeigniter-basic-helper` via\n  Composer\n\n## Instructions for installing packages into the project\n\n1. Install the package into the project with the following command\n\n```shell\ncomposer require nguyenanhung/codeigniter-framework\n```\n\n2. Update the `index.php` file\n\nFind the line\n\n```php\n/*\n *---------------------------------------------------------------\n * SYSTEM DIRECTORY NAME\n *---------------------------------------------------------------\n *\n * This variable must contain the name of your \"system\" directory.\n * Set the path if it is not in the same directory as this file.\n */\n\t$system_path = 'system';\n```\n\nEdit as follows\n\n```php\n/*\n *---------------------------------------------------------------\n * SYSTEM DIRECTORY NAME\n *---------------------------------------------------------------\n *\n * This variable must contain the name of your \"system\" directory.\n * Set the path if it is not in the same directory as this file.\n */\n\t$system_path = '/your_vendor_path/nguyenanhung/codeigniter-framework/system';\n```\n\n3. Delete the `system` folder in the project root folder for neatness\n\n## User guide\n\n### Instructions for writing a Controller that inherits a Base Controller\n\nIn the library, there is a built-in Base Controller, inherit as follows\n\n1. Build a new `Controller` according to the CodeIgniter 3 documentation\n2. Inherit the class from `HungNG_CI_Base_Controllers` instead of `CI_Controller`, for example as follows\n\n```php\n\u003c?php\n/**\n * Class Hungna_test\n *\n * @author    713uk13m \u003cdev@nguyenanhung.com\u003e\n * @copyright 713uk13m \u003cdev@nguyenanhung.com\u003e\n */\nclass Hungna_test extends HungNG_CI_Base_Controllers\n{\n\tpublic function __construct()\n    {\n        parent::__construct();\n    }\n  \t\n  \tpublic function index()\n    {\n\t\techo \"This is \".get_class($this); // show: This is Hungna_test\n\t\texit();\n    }\n}\n\n```\n\n### Instructions for writing a Controller that runs a Queue Worker\n\nIn the library, there is a built-in Base Queue Worker (built by yidas), inherit as follows\n\n1. Build a new `Controller` according to the CodeIgniter 3 documentation\n2. Inherit the class from `HungNG_CI_Base_Queue_Worker` instead of `CI_Controller`, for example as follows\n\n```php\n\u003c?php\n/**\n * Class My_worker\n *\n * @author    713uk13m \u003cdev@nguyenanhung.com\u003e\n * @copyright 713uk13m \u003cdev@nguyenanhung.com\u003e\n */\nclass My_worker extends HungNG_CI_Base_Queue_Worker\n{\n    // Initializer\n    protected function init() {}\n    \n    // Worker\n    protected function handleWork() {}\n    \n    // Listener\n    protected function handleListen() {}\n}\n\n```\n\nLearn more details in the documentation\nhere: [https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-queue-worker](https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-queue-worker)\n\n### Instructions for writing a Controller to run RESTful API Service\n\nIn the library, there is a pre-built RESTful Base (built by yidas), inherit as follows\n\n1. Build a new `Controller` according to the CodeIgniter 3 documentation\n2. Inherit the class from `HungNG_CI_Base_REST` instead of `CI_Controller`, for example as follows\n\n```php\n\u003c?php\n/**\n * Class My_rest_api\n *\n * @author    713uk13m \u003cdev@nguyenanhung.com\u003e\n * @copyright 713uk13m \u003cdev@nguyenanhung.com\u003e\n */\nclass My_rest_api extends HungNG_CI_Base_REST\n{\n    public function index()\n    {\n        return $this-\u003eresponse-\u003ejson(['bar'=\u003e'foo']);\n    }\n    \n\tpublic function store($requestData=null) {\n\t\n\t    $this-\u003edb-\u003einsert('mytable', $requestData);\n\t    $id = $this-\u003edb-\u003einsert_id();\n\t    \n\t    return $this-\u003eresponse-\u003ejson(['id'=\u003e$id], 201);\n\t}\n}\n\n```\n\nLearn more details in the documentation\nhere: [https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-rest](https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-rest)\n\n### Instructions for writing a Model that inherits Base Model\n\n1. Build a model according to the CodeIgniter 3 documentation\n2. Inherit the class from `HungNG_Custom_Based_model` instead of `CI_Model`, for example as follows\n\n```php\n\u003c?php\ndefined('BASEPATH') or exit('No direct script access allowed');\n\n/**\n * Class Credentials_model\n *\n * @author    713uk13m \u003cdev@nguyenanhung.com\u003e\n * @copyright 713uk13m \u003cdev@nguyenanhung.com\u003e\n * @property \\CI_DB_query_builder $db\n */\nclass Credentials_model extends HungNG_Custom_Based_model\n{\n    const IS_ACTIVE = 1;\n    const ROLE_PUSH = 1;\n    const ROLE_PULL = 2;\n    const ROLE_FULL = 3;\n\n    protected $fieldUsername;\n    protected $fieldStatus;\n    protected $fieldRole;\n\n    /**\n     * Credentials_model constructor.\n     *\n     * @author   : 713uk13m \u003cdev@nguyenanhung.com\u003e\n     * @copyright: 713uk13m \u003cdev@nguyenanhung.com\u003e\n     */\n    public function __construct()\n    {\n        parent::__construct();\n        $this-\u003edb            = $this-\u003eload-\u003edatabase('default', true, true);\n        $this-\u003etableName     = 'credentials';\n        $this-\u003eprimary_key   = 'id';\n        $this-\u003efieldUsername = 'username';\n        $this-\u003efieldStatus   = 'status';\n        $this-\u003efieldRole     = 'role';\n    }\n}\n```\n\n### How to write a Model that inherits the Base ORM Model\n\n1. This package adds a modern way to write models in ORM style with Elegant patterns like Laravel Eloquent ORM \u0026 Yii2\n   Active Record (built by yidas)\n2. Read detailed documentation on how to integrate and deploy here with visual and specific\n   examples: [https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-orm-model](https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-orm-model)\n\n### Basic SEO Integration Guide\n\n1. This package adds a simple SEO library and helper\n\n2. Read detailed documentation on how to integrate and deploy here with visual and specific\n   examples: [https://github.com/nguyenanhung/codeigniter-framework-sample/blob/main/codeigniter3-basic-seo/README.md](https://github.com/nguyenanhung/codeigniter-framework-sample/blob/main/codeigniter3-basic-seo/README.md)\n\n### Instructions for using MongoDB database in the project\n\n1. By default, CodeIgniter v3 does not support MongoDB. However, that is not a limitation, CodeIgniter is an open\n   framework, so\n   I have added a library to support calling, interacting, and processing with MongoDB database, which is also quite\n   similar to CodeIgniter 2's Query\n   Builder. Read detailed documentation on how to integrate and deploy here with intuitive and specific\n   examples: [https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-mongodb](https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-mongodb)\n\n### Instructions for using Elasticsearch in the project\n\n1. By default, CodeIgniter v3 does not support Elasticsearch. However, that does not limit it, CodeIgniter is an open\n   framework,\n   so I have added a library to support calling and interacting with Elasticsearch\n2. Read detailed documentation on how to integrate and deploy here with intuitive and specific\n   examples: [https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-elasticsearch](https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-elasticsearch)\n\n### Instructions for integrating HMVC model into the project\n\n1. Create folder: `modules` in the `application` folder. Refer to the `modules-samples` folder structure\n   at https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/modules-sample\n\n```shell\n.\n└── modules\n    └── startup\n        ├── config\n        │   ├── index.html\n        │   └── routes.php\n        ├── controllers\n        │   ├── Startup.php\n        │   └── index.html\n        ├── index.html\n        ├── models\n        │   ├── Startup_model.php\n        │   └── index.html\n        └── views\n            └── index.html\n\n6 directories, 8 files\n```\n\n2. Create file `hmvc.php` with the following content\n\n```php\n\u003c?php\ndefined('BASEPATH') or exit('No direct script access allowed');\n/*\n| -------------------------------------------------------------------------\n| HMVC settings\n| -------------------------------------------------------------------------\n| See: https://github.com/nguyenanhung/CodeIgniter-HMVC\n|\n*/\n$config['modules_locations'] = array(\n    APPPATH . 'modules/' =\u003e '../modules/'\n);\n\n```\n\n3. Load the `hmvc.php` file into the `config.php` file\n\n```php\nrequire_once __DIR__ . '/hmvc.php';\n```\n\n4. Create file `MY_Loader.php` in folder `application/core/` with following content\n\n```php\n\u003c?php\ndefined('BASEPATH') or exit('No direct script access allowed');\n/**\n * Class MY_Loader\n *\n * @author    713uk13m \u003cdev@nguyenanhung.com\u003e\n * @copyright 713uk13m \u003cdev@nguyenanhung.com\u003e\n */\nclass MY_Loader extends HungNG_Loader\n{\n\n}\n```\n\n5. Create file `MY_Router.php` in folder `application/core/` with following content\n\n```php\n\u003c?php\ndefined('BASEPATH') or exit('No direct script access allowed');\n/**\n * Class MY_Router\n *\n * @author    713uk13m \u003cdev@nguyenanhung.com\u003e\n * @copyright 713uk13m \u003cdev@nguyenanhung.com\u003e\n */\nclass MY_Router extends HungNG_Router\n{\n\n}\n\n```\n\n6. Deploy the code in the new modules folder, similar to the following\n\n```php\n\u003c?php\ndefined('BASEPATH') or exit('No direct script access allowed');\n/**\n * Class TestModule\n *\n * @author    713uk13m \u003cdev@nguyenanhung.com\u003e\n * @copyright 713uk13m \u003cdev@nguyenanhung.com\u003e\n */\nclass TestModule extends HungNG_CI_Base_Module\n{\n\tpublic function __construct()\n    {\n        parent::__construct();\n    }\n  \t\n\tpublic function index()\n    {\n\t\techo \"This is \".get_class($this); // show: This is TestModule\n\t\texit();\n    }\n}\n\n```\n\n### How to check if the filenames in your project are up to CodeIgniter standards\n\n1. This controller checks CodeIgniter 3.0 class filename.\n\n2. Read detailed documentation on how to integrate and deploy here with visual and specific\n   examples: [https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter3-filename-checker](https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter3-filename-checker)\n\n### Instructions for logging all queries in CodeIgniter and recording the Execution Time of each Queries\n\n1. By default, CodeIgniter v3 does not support logging the Execution Time of Queries. However, you can use Hooks to do\n   this\n\n2. Read the detailed documentation on how to integrate and deploy here with visual and specific\n   examples: [https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-log-all-queries](https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-log-all-queries)\n\n## CodeIgniter Basic Helper\n\n- Over the years of programming with CodeIgniter, I have collected, built and written quite a few helpers, I have\n  packaged\n  them into the package `nguyenanhung/codeigniter-basic-helper` and integrated them into this package.\n- This helper package is still being operated and developed by me every day, the number of projects integrating the\n  functions in this package has reached\n  thousands\n- More detailed information about this helper\n  set [https://github.com/nguyenanhung/codeigniter-basic-helper](https://github.com/nguyenanhung/codeigniter-basic-helper)\n\n## Contact Information\n\n| Name        | Email                | Skype            | Facebook      | Website                  |\n|-------------|----------------------|------------------|---------------|--------------------------|\n| Hung Nguyen | dev@nguyenanhung.com | nguyenanhung5891 | @nguyenanhung | https://nguyenanhung.com |\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnguyenanhung%2Fcodeigniter-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnguyenanhung%2Fcodeigniter-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnguyenanhung%2Fcodeigniter-framework/lists"}