PHP Classes
elePHPant
Icontem

PHP Unique Number Repository: Maintain repositories of unique numbers via an API

Recommend this page to a friend!
  Info   View files Example   View files View files (31)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-07-27 (3 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 1 This week: 1All time: 9,664 This week: 224Up
Version License PHP version Categories
unique_number_reposi 1.0GNU Lesser Genera...5PHP 5, Web services, Math
Description Author

This package can maintain repositories of unique numbers via an API.

It provides a REST API that can be accessed to perform several types of operations to maintain one or more repositories that store unique numbers. Currently it can:

- Create, list and delete distinct repositories of unique numbers
- Stores a unique number in a given repository
- Get a list of all unique numbers in a repository
- Store a unique number in a given repository

The package also provides client code to access the repositories REST API.

  Performance   Level  
Name: nvb <contact>
Classes: 8 packages by
Country: Germany Germany
Innovation award
Innovation award
Nominee: 4x

 

Details

Unique Number Repository Webservice

Sometimes, you simple need to make sure you can fetch a unique number for a given problem scope. To easy things up, this project will create a rest based webservice as backend and a command line frontend to support you solving this problem.

REST Based Backend (Server)

  • endpoint s * "/unique-number-repository" * DELETE: deleted a repository and all its unique numbers * GET: returns list of all repository names * PUT: creates a new repository * "/unique-number-repository/{name}" * DELETE: deletes a number from this repository * GET: returns list of all numbers from this repository * PUT: creates a new number for this repository

Command Line Based Frontend (Client)

Install

By Hand

mkdir -p vendor/net_bazzline/unique_number_repository
cd vendor/net_bazzline/unique_number_repository
git clone https://github.com/bazzline/unique_number_repository .

With Packagist

composer require net_bazzline/unique_number_repository:dev-master

Configure

By Hand

cd <project root>/configuration
cp client.local.php.dist client.local.php
#adapt client.local.php
cp server.local.php.dist server.local.php
#adapt server.local.php

With setup

cd <project root>
./configuration/setup

Benefits

  • implement token authentication (you can and should override the existing token by creating your own client.local.php and server.local.php in configuration)

API

API is available at bazzline.net.

Thanks

History

  • upcomming * @todo * multiple storage (databases) are supported (right now, file storage is supported) * return the right status code (403 instead of 404) if a user tries to delete a number he does not own
  • 0.13.0 - released at 06.03.2016 * moved to psr-4 autoloading
  • 0.12.3 - released at 18.12.2015 * updated dependency
  • 0.12.2 - released at 19.11.2015 * updated dependency
  • 0.12.1 - released at 18.11.2015 * updated dependency
  • 0.12.0 - released at 30.09.2015 * changed "not authorized" http status code from wrong 403 to right 401 * introduced right usage of 403
  • 0.11.0 - released at 20.09.2015 * added restriction that only the creator (repository or number) can delete the resource
  • 0.10.4 - released at 16.09.2015 * fixed issue in authorization request * made https an optional requirement * updated README.md * updated dependency
  • 0.10.3 - released at 14.09.2015 addedAPI* section * updated dependencies
  • 0.10.2 - released at 13.09.2015 addedsetup* script to easy up after installation configuration
  • 0.10.1 - released at 13.09.2015 * fixed authentication problem
  • 0.10.0 - released at 13.09.2015 * downgraded to silex 1.2 to support php 5.3.3 * fixed broken links * increased compatibility by using '/usr/bin/env' for client code * removed unused dependencie
  • 0.9.0 - released at 12.09.2015 * silix based server/backend

Final Words

Star it if you like it :-). Add issues if you need it. Pull patches if you enjoy it. Write a blog entry if you use it. Donate something if you love it :-].

  Files folder image Files  
File Role Description
Files folder imagebootstrap (2 files)
Files folder imageclient (7 files)
Files folder imageconfiguration (4 files)
Files folder imageexample (1 file)
Files folder imagepublic (2 files)
Files folder imagesource (3 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  bootstrap  
File Role Description
  Accessible without login Plain text file client.php Example Example script
  Accessible without login Plain text file server.php Example Example script

  Files folder image Files  /  client  
File Role Description
  Accessible without login Plain text file check-version Example Example script
  Accessible without login Plain text file create-repository Example Example script
  Accessible without login Plain text file create-unique_number Example Example script
  Accessible without login Plain text file delete-repository Example Example script
  Accessible without login Plain text file delete-unique_number Example Example script
  Accessible without login Plain text file list-repositories Example Example script
  Accessible without login Plain text file list-unique_number Example Example script

  Files folder image Files  /  configuration  
File Role Description
  Accessible without login Plain text file client.local.php.dist Data Auxiliary data
  Accessible without login Plain text file locator.php Aux. Auxiliary script
  Accessible without login Plain text file server.local.php.dist Data Auxiliary data
  Accessible without login Plain text file setup Example Example script

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file basic_example Data Auxiliary data

  Files folder image Files  /  public  
File Role Description
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Accessible without login Plain text file index.php Aux. Auxiliary script

  Files folder image Files  /  source  
File Role Description
Files folder imageApplication (1 directory)
Files folder imageDomain (1 directory)
Files folder imageInfrastructure (1 directory)

  Files folder image Files  /  source  /  Application  
File Role Description
Files folder imageService (4 files)

  Files folder image Files  /  source  /  Application  /  Service  
File Role Description
  Plain text file ApplicationLocator.php Class Class source
  Plain text file InvalidArgumentException.php Class Class source
  Plain text file NumberEnumerator.php Class Class source
  Plain text file UniqueNumberEnumeratorFactory.php Class Class source

  Files folder image Files  /  source  /  Domain  
File Role Description
Files folder imageModel (2 files)

  Files folder image Files  /  source  /  Domain  /  Model  
File Role Description
  Plain text file RepositoryRequest.php Class Class source
  Plain text file UniqueNumberRequest.php Class Class source

  Files folder image Files  /  source  /  Infrastructure  
File Role Description
Files folder imageStorage (6 files)

  Files folder image Files  /  source  /  Infrastructure  /  Storage  
File Role Description
  Plain text file AbstractStorage.php Class Class source
  Plain text file AbstractStorageFactory.php Class Class source
  Plain text file RepositoryStorage.php Class Class source
  Plain text file RepositoryStorageFactory.php Class Class source
  Plain text file UniqueNumberStorage.php Class Class source
  Plain text file UniqueNumberStorageFactory.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:1
This week:1
All time:9,664
This week:224Up