Download the PHP package robinscholz/better-rest without Composer

On this page you can find all versions of the php package robinscholz/better-rest. 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 better-rest

🤝 Better REST

Release Stars Downloads Issues Build Status Coverage Status Twitter Twitter

A Kirby plugin that exposes the internal REST API at /rest with the option to convert Kirbytags to HTML and add a srcset to images in the process. Intended to convert Kirby into a headless CMS.

Disclaimer

While this plugin is still functional, quite a few alternatives exist for turning Kirby into a headless content management system. If you are looking for a more sophisticated and modern solution, please take a look at the Kirby Query Language plugin, the recent work of Johann Schopplich or Kirby Content Representations.

Usage

The API can be accessed at /rest. The plugin only allows GET requests.

Authentification

Requests need to be authenticated via Basic Auth. It’s recommended to create a seperate API User with either a custom blueprint or with the one provided by this plugin called better-rest API. Read more about user roles in the docs.

Basic Auth needs to be enabled in the site/config/config.php:

Kirby 3 API

Examples:

Official Kirby 3 API docs

Better-Rest Settings from Query

All standard setting as well as settings defined in site/config/onfig.php can be overwritten on a per-request basis. Simply prefix the setting with br- and include it as a query.

Examples:

Multilang

The plugin supports multiple language settings. To fetch content for a specific language include a X-Language header containing the desired language code with your request. Alternatively a br-language query can be used.

Settings

Config File

All settings need to be prefixed with robinscholz.better-rest.!

Settings Default Options
kirbytags true boolean
smartypants false boolean
srcset [375, 667, 1024, 1680] Array or false
language null null or string

Caveats

HTTPS

The Kirby installation needs to be served with a TLS Certicificate via https.

Local setup

For local development use Laravel Valet or disable https in the site/config/config.php:

WARNING: Do not use this setting for production environments!

Installation

Download

Download and copy this repository to /site/plugins/better-rest.

Composer

Git submodule

Credits

A big thanks to @bnomei who refactored the initial source code into something extendable and future proof. If you are using this plugin please consider buying him a ☕!

License

MIT


All versions of better-rest with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3.0
getkirby/composer-installer Version ^1.1
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 robinscholz/better-rest contains the following files

Loading the files please wait ....