Download the PHP package braid/shorten without Composer

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

Shorten


Build Status Scrutinizer Code Quality Code Coverage License

Need an easy to use custom URL shortener like bit.ly, t.co, goo.gl? Shorten is a simple, PSR-7 and PSR-15 compliant headless URL shortener made for developers like you.

Installation

Download

Shorten is a small micro application. It is easily installed with composer’s create-project command.

Configuration

Shorten comes with two example configuration files. To configure your instance, just copy these files:

config.php

Edit your newly created config.php as appropriate.

Option Description
base_url You'll want to set your application’s base_url to the domain name you are using as a shortener (http://bit.ly for example).
api_secret Choose a randomly generated key (>32 bytes recommended). This will be your application’s Bearer token for api requests.
database Shorten uses Laravel’s excellent Eloquent ORM. Configure the database credentials here. MySQL/MariaDB is recommended for medium/high traffic, but a simple SQLite is also supported.

Pro Tip: here’s a quick way to generate an api key:

phinx.yml

Shorten uses Rob Morgan’s Phinx for database migrations. Phinx has its own configuration, but the values should be the same as your config.php database settings.

Database

Once your configuration files have been created and updated, go ahead and create the database you specified in the above configuration file. Then simply run the migrations:

Server

The last step is to simply point an http server or virtual host to the public directory. This documentation won't go into detail on how to setup Apache or nginx.

Api

Shorten comes with a simple API for creating, listing, and removing shortened urls.

Method Endpoint Description
GET /resources List all shortened URLs currently stored.
POST /resources Creates a new URL. Must include a JSON body with a url attribute.
DELETE /resources Removes a shortened URL. Must include a JSON body with an id attribute.

All api requests MUST include an Authorization header in the format:

The return format for redirect resources is JSON. Example:

Note: Yes DELETE /resources/{id} would be cleaner, but using simple strings allows for faster routing.

Best practices

Shorten is intended to be a simple set-and-forget service you can use internally at your organization or embed into the apps you build. Keep in mind it is a project and not a dependency, so you are free and encouraged to bolt on additional PSR-15 middleware if you want.

Sponsor

Shorten is written and maintained by Braid LLC, and offered freely under an MIT license.

Braid LLC


All versions of shorten with dependencies

PHP Build Version
Package Version
Requires zendframework/zend-diactoros Version ^1.6
mindplay/middleman Version 3.0.0.x-dev
illuminate/database Version ^5.5
robmorgan/phinx Version ^0.9.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 braid/shorten contains the following files

Loading the files please wait ....