Download the PHP package chalarangelo/codeigniter-rap without Composer

On this page you can find all versions of the php package chalarangelo/codeigniter-rap. 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-rap

CodeIgniter RAP

Simple RESTful API boilerplate for the CodeIgniter framework.

Introduction

The CodeIgniter RESTful API is a set of simple, modular helpers that can be easily integrated into your CodeIgniter projects, allowing you to create customizable RESTful APIs that suit all your needs. The package includes helpers for database manipulation, JSON Web Token generation, validation and signing, authentication methods, methods for accessing resources using a URI, as well as some utility methods that will help streamline your workflow.

Requirements

Installation

  1. Copy and paste all the files from application to the corresponding directory in your application.
  2. Copy and paste the config.example.ini file outside your application folder or create yours, based on the example provided. Remember to name your file config.ini or rename the sample provided.
  3. Create your own secret key and update config.ini to be completely secure.
  4. (Optional) Copy and paste the .example.htaccess file and tweak it to your liking. Remember to rename it to .htaccess.
  5. (Recommended) Enable HTTPS for your server for maximum security.

Contents

The API is made up of a set of helpers, each one serving a different purpose. Click on each helper below to read about its functionality.

error_code

Contains values for various error codes. The codes are mostly matched to HTTP status codes, but some of them might not be perfect matches. The error codes are stored as global variables.

Variable Value Description
PROHIBITED 405 The action is not allowed.
BAD_DATA 400 The data is malfored or does not match expected input.
BAD_CREDENTIALS 403 The credentials provided cannot be successfully authorized.
UNAUTHORIZED 403 The user has not the proper authorization to perform this action.
NO_COOKIE 409 The expected cookie was not found.
SUCCESS 200 The action was successful.

request

Contains a single method for retrieving the body of the current request.

database

Contains multiple methods for connecting and retrieving information from the database.

jwt

Heavily based on this implementation, the JWT helper allows for the creation of JSON Web Tokens. The secret key provided in config.ini will be used to sign the token.

auth

Contains multiple methods used for authorization, authorization validation and usage with JSON Web Tokens in cookies.

rest-api

Contains multiple methods, implementing generic CRUD methods for a RESTful API. For security reasons, certain methods are not implemented, but rather return an associative array with an error code and a message.

How to use

The provided helpers are supposed to be used in a CI_Controller, but you can use them any way you like. The sample provided (controllers/Api.php) is a pretty good starting point for a RESTful API implementation:

To query the API, you should use something like example.com/index.php/api/resource_name (or example.com/api/resource_name, if you are using the .htaccess file provided, configured to your environment), replacing resource_name with your resource's name (e.g. users). Bear in mind that certain requests will return errors due to implementation specifics.

License

The project is licensed under the MIT license.


All versions of codeigniter-rap with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.7
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 chalarangelo/codeigniter-rap contains the following files

Loading the files please wait ....