Download the PHP package hrishikesh214/php-api without Composer

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

PHP API

Index

  1. Installation
  2. Documentation
  3. Creating Endpoint
  4. Passing URL Parameters
  5. Post Parameters
  6. API Tracer
  7. Setting Error Handlers
  8. External Routes

Installation

And then in your file

Configurations

Before getting into PHPAPI we have to make some configs

In your root directory, create .htaccess file and paste following code

Documentation

Creating a client

You can also pass base address

All child endpoints will be access after api/

Running Client

This $client->run() returns response string, so you can store it in variable for further process or directly print it as response

Creating an Endpoint

Only some request methods are allowed : 'PUT', 'POST', 'DELETE', 'PATCH', 'GET', 'PURGE'

mount returns boolean value about whether endpoint is mounted successfully or not

Passing URL Parameters

Client will automatically pass url parameters to the response function

example is given below

URI Parameters are directly passed to the responder function in an associative array according to the key passed in parameter

All other posted parameters will automatically get stored in $_POST

NOTE If parameter is define while mounting but not passes then it is given a null value

POST Endpoint

Trace Whole API

You can trace whole API Client with detailed configs of all endpoints mounted with a function

If Above value is true final api result will also included api configs

This Also includes Requested configs

Example output:-

In above example result will contain result coming from API

Setting Request Errors

There is a default error handler but you change it!

404

405

External Routes

Importing Routes from external file

You can also define routes in external file all you need is to use Helper Class.

For example (folder structure):-

In above code $config['base']' will be act as base to all routes present in this file.

$routes will contain all routes.

Please maintain format else code will not work!

Made with ❤️By Hrishikesh


All versions of php-api with dependencies

PHP Build Version
Package Version
No informations.
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 hrishikesh214/php-api contains the following files

Loading the files please wait ....