Download the PHP package vaslv/brevity-php-sdk without Composer

On this page you can find all versions of the php package vaslv/brevity-php-sdk. 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 brevity-php-sdk

Brevity PHP SDK

PHP client for the Brevity short-link engine API.

Русская версия: README.ru.md

Packagist Version CI Plumb score

Features

Requirements

Installation

Quick start

The API is served only on the technical host (the one behind APP_URL); short-link domains answer 404 to any /api/... request. The token is issued from the admin panel and must carry the links:create ability — newly issued tokens also get links:read and links:update.

Usage

Conditions and A/B variants

Condition types: time_before, after_date, query_param, ip_address, device, language — see API.md (§6) for the data shape of each. Condition data passes through the SDK untouched.

Activity window and click budget

Outside the window, or once the budget is exhausted, the link answers 404.

Domain selection

Reading a link

Updating a link

Untouched fields keep their server-side values; setRules() replaces the whole rule list. code and domain cannot be changed.

Error handling

Every /api/v1 error is an RFC 7807 problem; the SDK dispatches on the stable type code:

type HTTP Exception
unauthenticated 401 AuthenticationException
missing-ability 403 MissingAbilityException
forbidden 403 ForbiddenException
not-found 404 NotFoundException
validation-error 422 ValidationException (getErrors())
too-many-requests 429 RateLimitException (getRetryAfter())
http-error, server-error other ApiException

An unknown type (a proxy answering instead of the API, a future contract code) falls back to the HTTP-status mapping; the raw code stays available via getProblemType().

All of the above extend ApiException (getStatusCode(), getResponseBody(), getProblemType()); MissingAbilityException extends ForbiddenException. Network/timeout failures throw TransportException; client-side misuse (contradictory options, an empty patch) throws InvalidRequestException before any HTTP round trip.

Rate limits: two independent budgets — reads and writes — of 120 requests per minute per service.

Laravel

The service provider and the Brevity facade are auto-discovered on Laravel 5.8+. Configure via .env:

Publish the config when you need to tweak it: php artisan vendor:publish --tag=brevity-config.

Testing

No local PHP toolchain needed — the suite runs in Docker:

Documentation

The full API contract lives in API.md — a copy of the canonical English docs/03-api.md of the main repository, where a Russian mirror is kept under docs/ru/.

License

MIT


All versions of brevity-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
ext-json Version *
guzzlehttp/guzzle Version ^6.5.8 || ^7.4.5
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 vaslv/brevity-php-sdk contains the following files

Loading the files please wait ...