Download the PHP package brannonh/snapi-file without Composer

On this page you can find all versions of the php package brannonh/snapi-file. 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 snapi-file

snAPI-File

A simple PHP REST API to access data stored in the filesystem

Purpose

This is an extremely lightweight REST API that utilizes (JSON) files as data stores. Just name your stores and point them to a file, and snAPI-File will handle the rest.

Support

If you run into any problems, please let us know by opening a new issue.

Store File

You must point snAPI-File to the stores you want to use. By default, snAPI-File loads those from a stores.json file, however you may change that through the constructor (see below).

The store file should be in the following format.

The store being used is sent in each request. Only stores referenced in the store file are supported. Any other referenced store will result in an HTTP 404 error.

Usage

Setup

Setting up the API is simple. Just create your store file and add the following lines to your PHP file.

That's it. snAPI-File will handle the requests from there.

API

__construct($storeFile)

Parameters
Parameter Type Required Default Notes
$storeFile string 'stores.json' The default file is created in the same directory as your PHP file.
Returns
Type Notes
Api The Api object

:tophat:

go()

Parameters
Parameter Type Required Default Notes
void
Returns
Type Notes
void

:tophat:

Client Requests

Requests to snAPI-File must be either GET or POST and include a specific set of parameters.

Parameter Required Notes
store :heavy_check_mark: The store to use
action :heavy_check_mark: The action to perform (i.e., create, retrieve, update, delete)
key The key in the store to affect

Only required for create, update, and delete actions. Use with retrieve to get a specific record from the store. Omit from retrieve to get all records from the store.
value :heavy_check_mark: The value to use to affect key

All versions of snapi-file 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 brannonh/snapi-file contains the following files

Loading the files please wait ....