2017 © Pedro Peláez
 

library n4b

N4B PHP library

image

n4b/n4b

N4B PHP library

  • Thursday, February 23, 2017
  • by Kinobi
  • Repository
  • 1 Watchers
  • 2 Stars
  • 122 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 3 % Grown

The README.md

N4B PHP Library

Simple library to quickly implement a N4B Be-App PHP backend, (*1)

Latest Stable Version Build Status SensioLabs Insight Dependencies GitHub issues License, (*2)

Why ?

N4B PHP will allow you to concentrate your development only on your business domain. Authentication, operations dispatching, N4B Errors, formatting of the responses are handled by the library., (*3)

What is N4B by Be-Bound ?

Be-Bound's N4B platform helps you develop Android applications with the possibility to reach the Next 4 Billion (N4B) users that are still not connected to the Internet. By integrating Be-Bound’s SDK into your Android apps, and implementing your Be-App Webhooks, your users will stay connected to your apps even when there is no internet., (*4)

Learn More about N4B by Be-Bound

Installation

N4B PHP works with PHP 5.6.0 or newer., (*5)

It's recommended that you use Composer to install N4B PHP., (*6)

$ composer require n4b/n4b

This will install N4B PHP and all required dependencies., (*7)

Usage

Create an index.php file with the following contents:, (*8)

<?php

require 'vendor/autoload.php';

$n4b = new N4B\Webhook('mybeapp', 1337, 1, 'MY5UP3r53Cr37K3Y');

$n4b->add('myOperation', function($params, $transport, $userId) {
    return ['uppercaseString' => strtoupper($params['someString'])];
});

$n4b->run();

You may quickly test this using the built-in PHP server:, (*9)

$ php -S localhost:8000

Then running the cURL POST request below (or use the Postman button) will now return a well formated N4B response "{"params":["uppercaseString","THIS VERY INTERESTING TEXT WILL BE OUTPUT IN UPPERCASE"]}"., (*10)

Run in Postman, (*11)

curl --request POST \
  --url http://localhost:8000/ \
  --header 'authorization: Basic bXliZWFwcF8xMzM3Ok1ZNVVQM3I1M0NyMzdLM1k=' \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --data '{"transport":"web","userId":"98e866b2-3d39-11e6-97dc-0cc47a77819c","moduleId":1337,"moduleName":"mybeapp","moduleVersion":1,"operation":"myOperation","params":{"someString":"this very interesting text will be output in uppercase"}}'

Documentation

Change log

Please see CHANGELOG for more information what has changed recently., (*12)

Testing

bash $ composer test, (*13)

About

Security, bugs and feature requests

Bugs and feature request are tracked on GitHub, (*14)

If you discover any security related issues, please email lbrianto@be-bound.com instead of using the issue tracker., (*15)

Author

Lionel Brianto - lbrianto@be-bound.com - http://twitter.com/kinobiweb , (*16)

License

N4B PHP is licensed under the MIT License - see the LICENSE file for details, (*17)

The Versions

23/02 2017

dev-master

9999999-dev https://github.com/kinobi/n4b

N4B PHP library

  Sources   Download

MIT

The Requires

 

The Development Requires

be-bound n4b

23/02 2017

1.1.3

1.1.3.0 https://github.com/kinobi/n4b

N4B PHP library

  Sources   Download

MIT

The Requires

 

The Development Requires

be-bound n4b

23/02 2017

1.1.2

1.1.2.0 https://github.com/kinobi/n4b

N4B PHP library

  Sources   Download

MIT

The Requires

 

The Development Requires

be-bound n4b

02/12 2016

1.1.1

1.1.1.0 https://github.com/kinobi/n4b

N4B PHP library

  Sources   Download

MIT

The Requires

 

The Development Requires

be-bound n4b

25/09 2016

1.1.0

1.1.0.0 https://github.com/kinobi/n4b

N4B PHP library

  Sources   Download

MIT

The Requires

 

The Development Requires

be-bound n4b

24/09 2016

1.0.3

1.0.3.0 https://github.com/kinobi/n4b

N4B PHP library

  Sources   Download

MIT

The Requires

  • php ^5.6.0 || ^7.0

 

The Development Requires

be-bound n4b

23/09 2016

1.0.2

1.0.2.0 https://github.com/kinobi/n4b

N4B PHP library

  Sources   Download

MIT

The Requires

  • php ^5.6.0 || ^7.0

 

The Development Requires

be-bound n4b

20/09 2016

1.0.1

1.0.1.0 https://github.com/kinobi/n4b

N4B PHP library

  Sources   Download

MIT

The Requires

  • php ^5.6.0 || ^7.0

 

The Development Requires

be-bound n4b

19/09 2016

1.0.0

1.0.0.0 https://github.com/kinobi/n4b

N4B PHP library

  Sources   Download

MIT

The Requires

  • php ^5.6.0 || ^7.0

 

The Development Requires

be-bound n4b