{"id":14987347,"url":"https://github.com/kenjis/ci4-app-template","last_synced_at":"2025-04-12T00:02:19.841Z","repository":{"id":39643492,"uuid":"329872020","full_name":"kenjis/ci4-app-template","owner":"kenjis","description":"CodeIgniter4 Application Template - This template changes the CI4 default config more secure.","archived":false,"fork":false,"pushed_at":"2024-02-03T07:56:03.000Z","size":568,"stargazers_count":19,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"ci4-app-template","last_synced_at":"2025-03-25T19:51:08.344Z","etag":null,"topics":["codeigniter","codeigniter4","project-template"],"latest_commit_sha":null,"homepage":"","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/kenjis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2021-01-15T09:52:08.000Z","updated_at":"2024-08-19T04:59:39.000Z","dependencies_parsed_at":"2024-11-14T14:27:32.056Z","dependency_job_id":"0ec33bed-c37a-4ec1-a498-e6df46b217ac","html_url":"https://github.com/kenjis/ci4-app-template","commit_stats":{"total_commits":171,"total_committers":1,"mean_commits":171.0,"dds":0.0,"last_synced_commit":"a5f694bdfa96a7e57b2c8cc1ea743973eabf6848"},"previous_names":[],"tags_count":24,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fci4-app-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fci4-app-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fci4-app-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjis%2Fci4-app-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenjis","download_url":"https://codeload.github.com/kenjis/ci4-app-template/tar.gz/refs/heads/ci4-app-template","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497805,"owners_count":21113984,"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","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","codeigniter4","project-template"],"created_at":"2024-09-24T14:14:29.077Z","updated_at":"2025-04-12T00:02:19.776Z","avatar_url":"https://github.com/kenjis.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeIgniter 4 Application Template\n\nThis template changes the default configuration of CI4 more secure.\n\nThis repository includes:\n\n- [CodeIgniter](https://github.com/codeigniter4/CodeIgniter4) 4.4.5\n  - [Translations for CodeIgniter 4 System Messages](https://github.com/codeigniter4/translations) dev-develop\n  - [CodeIgniter DevKit](https://github.com/codeigniter4/devkit) 1.2.0\n- [PHPUnit](https://github.com/sebastianbergmann/phpunit) 9.6.16\n- [Tatter\\Patches](https://github.com/tattersoftware/codeigniter4-patches) 2.1.0\n- [Liaison Revision](https://github.com/paulbalandan/liaison-revision) 1.1.0\n- [bear/qatools](https://github.com/bearsunday/BEAR.QATools) 1.10.0\n\n## Requirements\n\n- [PHP 7.4](https://www.php.net/releases/7_4_0.php) or later\n  - [intl](http://php.net/manual/en/intl.requirements.php)\n  - [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\\CURLRequest library\n  - json (enabled by default - don't turn it off)\n  - [mbstring](http://php.net/manual/en/mbstring.installation.php)\n  - [mysqlnd](http://php.net/manual/en/mysqlnd.install.php) if you plan to use MySQL\n  - xml (enabled by default - don't turn it off)\n\n## How to Install\n\n### Composer\n\n```sh-session\n$ composer create-project kenjis/ci4-app-template your-project\n```\n\n### Git\n\n```sh-session\n$ git clone https://github.com/kenjis/ci4-app-template.git your-project\n$ cd your-project/\n$ composer install\n$ git checkout -b main\n```\n\n## How to Update\n\nUpdate Composer packages:\n\n```sh-session\n$ composer update\n```\n\nUpdate your CodeIgniter4 project files:\n\n```sh-session\n$ php spark revision:update\n```\n\n## How to Use\n\n### Services\n\n- All Services must be manually added to `app/Config/Services.php`, even if third-party CI4 packages have their own Services.\n\n### CSRF\n\n- You must set CSRF token field in your form manually. See https://codeigniter4.github.io/CodeIgniter4/libraries/security.html#html-forms\n\n### CSP\n\n- You must set CSP when you need. See https://codeigniter4.github.io/CodeIgniter4/outgoing/response.html#content-security-policy\n- You need to use `csp_script_nonce()` and `csp_style_nonce()` for inline contents. See https://codeigniter4.github.io/CodeIgniter4/outgoing/response.html#inline-content\n\n## Changes from the CI4 Default Configuration\n\n### Services\n\n- Auto-Discovery of services is disabled. [app/Config/Modules.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Modules.php#L82).\n- `Config\\Services` extends `CodeIgniter\\Config\\Services`. [app/Config/Services.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Services.php#L20).\n\n### Configs\n\n- BaseURL's `index.php` is removed.\n  - [app/Config/App.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/App.php#L43)\n- Auto Routing (Improved) is enabled. \n  - [app/Config/Routing.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Routing.php#L93) and [app/Config/Feature.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Feature.php#L29)\n  - See https://codeigniter4.github.io/CodeIgniter4/incoming/routing.html#auto-routing-improved\n- `Config\\CURLRequest::$shareOptions` is disabled. (Since v4.4.0, this is set by default.)\n  - [app/Config/CURLRequest.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/CURLRequest.php#L19). \n  - See https://codeigniter4.github.io/CodeIgniter4/libraries/curlrequest.html#sharing-options\n- MySQLi's `numberNative` is enabled.\n  - [app/Config/Database.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Database.php#L45)\n  - See https://codeigniter4.github.io/CodeIgniter4/database/configuration.html#explanation-of-values\n- Using Session-based CSRF protection. \n  - [app/Config/Security.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Security.php#L18). \n  - See https://codeigniter4.github.io/CodeIgniter4/libraries/security.html#csrf-protection-methods\n- CSRF protection `$tokenRandomize` is enabled. \n  - [app/Config/Security.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Security.php#L29). \n  - See https://codeigniter4.github.io/CodeIgniter4/libraries/security.html#token-randomization\n- CSP is enabled. \n  - [app/Config/App](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/App.php#L176). \n  - See https://codeigniter4.github.io/CodeIgniter4/outgoing/response.html#turning-csp-on\n- CSP `$autoNonce` is disabled. \n  - [app/Config/ContentSecurityPolicy](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/ContentSecurityPolicy.php#L175). \n  - See https://codeigniter4.github.io/CodeIgniter4/outgoing/response.html#inline-content\n- Strict Validation Rules are used. (Since v4.3.0, this is set by default.)\n  - [app/Config/Validation.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Validation.php#L24-L27). \n  - See https://codeigniter4.github.io/CodeIgniter4/libraries/validation.html#traditional-and-strict-rules\n\n### Filters\n\n- CSRF filter is enabled. \n  - [app/Config/Filters.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Filters.php#L60-L63). \n  - See https://codeigniter4.github.io/CodeIgniter4/libraries/security.html#enable-csrf-protection\n- InvalidChars filter is enabled. \n  - [app/Config/Filters.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Filters.php#L39). \n  - See https://codeigniter4.github.io/CodeIgniter4/incoming/filters.html#invalidchars\n- SecureHeaders filter is enabled. \n  - [app/Config/Filters.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Filters.php#L44). \n  - See https://codeigniter4.github.io/CodeIgniter4/incoming/filters.html#secureheaders\n\n### Features\n\n- `Config\\Feature::$multipleFilters` is enabled. \n  - [app/Config/Feature.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Feature.php#L24). \n  - See https://codeigniter4.github.io/CodeIgniter4/incoming/routing.html#applying-filters\n\n### Others\n\n- Using `develop` version CI4. [app/Config/Paths.php](https://github.com/kenjis/ci4-app-template/blob/ci4-app-template/app/Config/Paths.php#L28).\n\n## Available Commands\n\n```\ncomposer test              // Run PHPUnit\ncomposer cs-fix            // Fix the coding style\ncomposer cs                // Check the coding style\ncomposer sa                // Run static analysis\ncomposer run-script --list // List all commands\n```\n\n## Related Projects for CodeIgniter 4.x\n\n### Libraries\n\n- [CodeIgniter 3 to 4 Upgrade Helper](https://github.com/kenjis/ci3-to-4-upgrade-helper)\n- [CodeIgniter3-like Captcha](https://github.com/kenjis/ci3-like-captcha)\n- [PHPUnit Helper](https://github.com/kenjis/phpunit-helper)\n- [CodeIgniter4 Attribute Routes](https://github.com/kenjis/ci4-attribute-routes)\n- [CodeIgniter Simple and Secure Twig](https://github.com/kenjis/codeigniter-ss-twig)\n- [CodeIgniter4 Viewi Demo](https://github.com/kenjis/ci4-viewi-demo)\n\n### Tutorials\n\n- [CodeIgniter 4 News Tutorial](https://github.com/kenjis/ci4-news)\n- [CodeIgniter 4 Validation Tutorial](https://github.com/kenjis/ci4-validation-tutorial)\n- [CodeIgniter4 Code Modules Test](https://github.com/kenjis/ci4-modules-test)\n- [CodeIgniter 4 File Upload](https://github.com/kenjis/ci4-file-upload)\n\n### Building Development Environment\n\n- [CodeIgniter4 Application Template](https://github.com/kenjis/ci4-app-template)\n- [CodeIgniter4 Composer Installer](https://github.com/kenjis/ci4-composer-installer)\n- [docker-codeigniter-apache](https://github.com/kenjis/docker-codeigniter-apache)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjis%2Fci4-app-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenjis%2Fci4-app-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjis%2Fci4-app-template/lists"}