Download the PHP package alesanchezr/slim-api-wrapper without Composer

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

Slim On Steroids

Build Status Coverage Status

Just a small slim wrapper to avoid doing the same things all over again every time I start a new API.

This package is ideal for doing micro-framework architectures where your api is distributed thru several independet servers/developments.

Instalation

If you are going to use Authorization headers you have to allow apache to use HTTP Headers in your .htaccess:

Creating an API in 1 minute 🧐

Here is an example on how to create a simple api with just one GET /hello endpoint

📝 Adding a readme to the API

It is good practice to add a README.md file written in markwdown, just call the $api->addReadme() method to specify the URI you will want users to access yout README.md

💻 Adding more endpoints

The API uses Slim PHP 3.0 on the background, you can add as many endpoints as you like following the Slim documetation.

💡 Here is a list of examples you can use.

🔑 JWT Authentication

  1. To create private/authenticated the endpoints just add ->add($inst->auth()); at the end of the edpoint like this:

  2. Add a secret seed to the API, this will be used as salt for the token generation and you only have to do this step once.

  3. Add at least one client to the API, you can pick a username but the secret key has to be generated using the generatePrivateKey method.

  4. Now you can make call any request but you have to add the key to the Request Authorization header or as access_token on the querystring:

Using QueriString for authentication

Using Authorization header for authentication

Aditional Info

Run the tests:


All versions of slim-api-wrapper with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
slim/slim Version ^3.0
monolog/monolog Version ^1.24
respect/validation Version ^1.1
phpunit/phpunit Version ^6.5
firebase/php-jwt Version ^5.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 alesanchezr/slim-api-wrapper contains the following files

Loading the files please wait ....