Download the PHP package ahmedebead/cake-rest-api without Composer

On this page you can find all versions of the php package ahmedebead/cake-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 cake-rest-api

CakeRestApi Plugin for CakePHP

Latest Stable Version Total Downloads Latest Unstable Version License

This plugin simplifies the CakeRestApi API development for your CakePHP 4.x application. It simply converts the output of your controller into a JSON response.

Installation

You can install this plugin into your CakePHP application using composer.

The recommended way to install composer packages is:

After installation, Load the plugin

Add this file to /src/Application.php

Or, you can load the plugin using the shell command

Usage

No major change requrires in the way you code in your CakePHP application. Simply, just add one parameter to your route configuration isRest like,

And extend your controller to RestController and everything will be handled by the plugin itself. For example,

And that's it. You will see the response as below.

Doesn't it too simple? Whatever viewVars you set from your controller's action using set() method, will be converted into JSON response.

Response Format

This plugin returns the response in the following format.

The status key may contain OK or NOK based on your response code. For all successful responses, the code will be 200 and the value of this key will be OK.

In case of error or exception, the value of status will become NOK. Also, based on your application's debug setting, it will contain the exception and trace data.

The result key contains the actual response. It holds all the variables set from your controller. This key will not be available in case of error/exception.

These properties are also available in your controller's beforeFilter method, so you can put additional authentication logic there.

Reporting Issues

If you have a problem with this plugin or found any bug, please open an issue on GitHub.


All versions of cake-rest-api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
cakephp/cakephp Version ^4.0
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 ahmedebead/cake-rest-api contains the following files

Loading the files please wait ....