{"id":15277425,"url":"https://github.com/ngthucdotcom/ci-composer","last_synced_at":"2026-01-04T17:35:02.180Z","repository":{"id":57026307,"uuid":"224546752","full_name":"ngthucdotcom/ci-composer","owner":"ngthucdotcom","description":"CodeIgniter core custom by ngthuc","archived":false,"fork":false,"pushed_at":"2020-07-13T10:26:52.000Z","size":1585,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T04:47:23.413Z","etag":null,"topics":["codeigniter","composer-project","custom"],"latest_commit_sha":null,"homepage":"https://ngthucdotcom.github.io/ci-composer/","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/ngthucdotcom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-28T01:31:38.000Z","updated_at":"2021-05-14T02:45:39.000Z","dependencies_parsed_at":"2022-08-23T16:20:32.780Z","dependency_job_id":null,"html_url":"https://github.com/ngthucdotcom/ci-composer","commit_stats":null,"previous_names":[],"tags_count":30,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngthucdotcom%2Fci-composer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngthucdotcom%2Fci-composer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngthucdotcom%2Fci-composer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngthucdotcom%2Fci-composer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngthucdotcom","download_url":"https://codeload.github.com/ngthucdotcom/ci-composer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245044493,"owners_count":20551898,"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","composer-project","custom"],"created_at":"2024-09-30T11:06:09.431Z","updated_at":"2026-01-04T17:35:02.143Z","avatar_url":"https://github.com/ngthucdotcom.png","language":"PHP","readme":"# Server Requirements\n* OS: Linux 18.04 (recommended)\n* PHP: PHP 5.6 or newer\n\n# Installation\n## Create project\n1. Run composer create project (for init new project) or update (for reload dependencies on new environment) via command line at root folder\n* Create project\n```shell\ncomposer create-project ngthuc/ci-composer\n```\n* Reload dependencies\n```shell\ncomposer update\n```\n2. Create .env file same [.]env to set-up database\n## Require project into another project\n1. Run composer require project (for init new project) or update (for reload dependencies on new environment) via command line at root folder\n* Require project\n```shell\ncomposer require ngthuc/ci-composer\n```\n* Reload dependencies\n```shell\ncomposer update\n```\n2. Move all files from `/vendor/ngthuc/ci-composer/app/` to the root folder structure:\n```shell\nroot                          # → Root Directory\n└── vendor/\n    └── ngthuc/\n        └── ci-composer/\n            └── app/\n                ├── apllication/\n                ├── public/\n                ├── .bowerrc\n                ├── .editorconfig\n                ├── .gitignore\n                ├── .htaccess\n                ├── [.]env\n                ├── bower.json\n                ├── index.php\n                └── license.txt\n```\n3. Create .env file same [.]env to set-up database\n\n# Usage\n* Use Apache - MySQL/MariaDB - PHP (AMP) stack as a software (e.g., [XAMPP](https://www.apachefriends.org/index.html)/[AMPPS](https://www.ampps.com/)/[WAMP](http://www.wampserver.com/en/))\n* Install AMP stack packages on Linux or Windows, and move project to root directory of Apache (e.g., `www/`) and use [built-in web server](https://www.php.net/manual/en/features.commandline.webserver.php) (with PHP 5.4.0 or newer) via command:\n```shell\nphp -S \u003caddress\u003e:\u003cport\u003e -t \u003cYOUR_PROJECT_FOLDER/\u003e\n# Example use this command on root directory\nphp -S localhost:8000\n```\n\n## Usage RestAPI\n\nCodeIgniter Rest Server is available on package.\n\nStep 1: Add this to your controller (should be before any of your code)\n\n```php\nuse chriskacerguis\\RestServer\\RestController;\n```\n\nStep 2: Extend your controller\n\n```php\nclass Example extends RestController\n```\n\nBasic GET example\n\nHere is a basic example. This controller, which should be saved as `Api.php`, can be called in two ways:\n\n* `http://domain/api/users/` will return the list of all users\n* `http://domain/api/users/id/1` will only return information about the user with id = 1\n\n```php\n\u003c?php\ndefined('BASEPATH') OR exit('No direct script access allowed');\n\nuse chriskacerguis\\RestServer\\RestController;\n\nclass Api extends RestController {\n\n    function __construct()\n    {\n        // Construct the parent class\n        parent::__construct();\n    }\n\n    public function users_get()\n    {\n        // Users from a data store e.g. database\n        $users = [\n            ['id' =\u003e 0, 'name' =\u003e 'John', 'email' =\u003e 'john@example.com'],\n            ['id' =\u003e 1, 'name' =\u003e 'Jim', 'email' =\u003e 'jim@example.com'],\n        ];\n\n        $id = $this-\u003eget( 'id' );\n\n        if ( $id === null )\n        {\n            // Check if the users data store contains users\n            if ( $users )\n            {\n                // Set the response and exit\n                $this-\u003eresponse( $users, 200 );\n            }\n            else\n            {\n                // Set the response and exit\n                $this-\u003eresponse( [\n                    'status' =\u003e false,\n                    'message' =\u003e 'No users were found'\n                ], 404 );\n            }\n        }\n        else\n        {\n            if ( array_key_exists( $id, $users ) )\n            {\n                $this-\u003eresponse( $users[$id], 200 );\n            }\n            else\n            {\n                $this-\u003eresponse( [\n                    'status' =\u003e false,\n                    'message' =\u003e 'No such user found'\n                ], 404 );\n            }\n        }\n    }\n}\n```\n\n# Author\n* [Nguyen Thuc](https://ngthuc.github.io/)\n* Homepage: ngthuc.com\n* Packagist: [Packaged](https://packagist.org/packages/ngthuc/ci-composer) by ngthuc\n* Email: contact[at]ngthuc.com\n\n# Credit\nThis project using projects or dependencies:\n* CodeIgniter by [B.C. Institute of Technology](https://github.com/bcit-ci/CodeIgniter) (originally from EllisLab).\n* PHP dotenv by [vlucas](https://github.com/vlucas/phpdotenv).\n* CodeIgniter RestServer by [chriskacerguis](https://github.com/chriskacerguis/codeigniter-restserver)\n\n# License\nCodeIgniter Core Custom is licensed under [MIT License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngthucdotcom%2Fci-composer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngthucdotcom%2Fci-composer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngthucdotcom%2Fci-composer/lists"}