Download the PHP package bulton-fr/bfw-api without Composer

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

bfw-api

Build Status Coverage Status Scrutinizer Code Quality Latest Stable Version License

Module to use an API with the BFW framework


Install :

You can use composer to get the module : composer require bulton-fr/bfw-api @stable

And to install the module : ./vendor/bin/bfwInstallModules

Config :

All config file for this module will be into app/config/bfw-api/. There are two files to configure (manifest.json is for the module update system).

First, the file config.php

Next, the file routes.php

It's all routes of your api. The prefix write into the other config file should not be added into the route url. To know the route format to use, please refer you to the exemple write into the routes.php config file.

Note : If not method is present, the route will respond to all http methods (get, set, put and delete).

Use it :

I will only explain to REST API because the GraphQL API is not implemented yet. I will update this section when it will implemented.

You will create you API class controllers into the directory /src/api/. All classes should extends the class \BfwApi\Rest class.

You will add a method for each used HTTP method for you controller. All datas receive from the request will be present into the property $datas. Il you want return an response, you can use the method sendResponsesendResponse(&$response). This method will automaticaly detect the response format to use (xml or json) from the HTTP request and convert your response to the correct format before sent it.

Example :

Configs :

Controller class :


All versions of bfw-api with dependencies

PHP Build Version
Package Version
Requires bulton-fr/bfw Version ~3.0.0-RC11@RC
nikic/fast-route Version ~v1.3
bulton-fr/php-to-xml Version 1.0.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 bulton-fr/bfw-api contains the following files

Loading the files please wait ....