Download the PHP package moudarir/codeigniter-rest-api without Composer

On this page you can find all versions of the php package moudarir/codeigniter-rest-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package codeigniter-rest-api

Codeigniter 3 API Rest

GitHub release (latest) GitHub license

A RESTful server implementation for Codeigniter 3 based on CodeIgniter RestServer

Break changes made in version 3.0. Full code refactoring and new route system implemented inspired from Luthier CI.

Table of contents

  1. Requirements
  2. Installation
  3. Implementation
  4. Usage
  5. Postman collection
  6. Todo

Requirements

Installation

The current version 3.0.* requires php 7.4 or higher (php supported versions)

This library uses Composer to be installed.

Run this command line (recommended) in the same path as your composer.json file:

Or, In your composer.json file, add the following code in require section:

And then run:

Implementation

Language / Translation

You can find the file associated with your language in the application/language/ folder. Based on the $config['language'] setting in your [your-project]/application/config/config.php configuration file.

Supported languages

Files & Configuration

The first thing to do is copying all required files in your CI project:

DO NOT change the [your-project]/application/config/rest-api-server.php and [your-project]/application/language/*/rest-api-server_lang.php filenames.

Make sure that the enable_hooks and composer_autoload keys in [your-project]/application/config/config.php file are set as following:

Next, set the following code in [your-project]/application/config/hooks.php file:

and in [your-project]/application/config/routes.php file:

Important

Execute the dumping/queries.sql file to create the tables needed for the API to work properly.

Tables that will be created are users, api_keys, api_key_limits and api_key_logs.

You're now ready to begin using the library 👌.

About Routes

The implementation of old routes is deprecated. The routes are now simplified for best use. See Usage.

Usage

Adding some routes for the next example in [your-project]/application/routes/api.php file (if not exists).

And now, we can create our [your-project]/application/controllers/api/ApiUsers.php controller:

Authentication methods

The Rest Server can be used with Basic or Bearer authorization type. However, it can be used without any authorization type (not secure).

The request limit currently only works in the Basic authorization type.

Postman collection

Import the collection

Downloaded our Postman collection, and import it into Postman.

Import the environment

We have also provided a Postman Environment that you need to import as well.

To understand what Postman environments are, please check this link.

Edit the environment variables

Update the endpoint variable to point to your Rest server. Ex: (https//myapi.com/) with trailing slash.

✨ That's it!

You can now use the Postman collection to test available requests.

In the Postman collection, the order of execution of the requests must be respected.

Todo


All versions of codeigniter-rest-api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
ext-libxml Version *
ext-simplexml Version *
firebase/php-jwt Version ^6.3
nesbot/carbon Version ^2.72
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package moudarir/codeigniter-rest-api contains the following files

Loading the files please wait ....