Download the PHP package sudhaus7/shortlink without Composer

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

Shortcutlink (Shortlink)

A urlshortener for TYPO3

What does it do:

This extension will create a short URL similar to bit.ly or similar services in an easy way. For the Integrator this means that the usual Viewhelpers for creating links have been extended and the shortener can be used transparently for any link created by a FLUID Viewhelper.

Additionaly a Service Class is available to create shortened URLs on the fly for example in a Plugin or in an Extbase Controller.

Available FLUID Viewhelpers

Import the namespace like this:

or like this:

The following ViewHelpers are available:

these ViewHelpers have all attributes available and behave the same way as their normal counterparts, except they will produce a shortened url

That means you can now replace any

simply with

Usage in PHP

a simple example to shorten a URL:

Locking a shortend URL to a frontend user

It is possible to lock a frontend user ID to the shortened URL, which means that the short link can only be opened with an existing frontend user Session with the same user id

For this all ViewHelpers have an additional attribute chainToUserid which accepts the user id of the frontend user it has to be chained to.

For example:

The resulting short link can only be opened if the user with the ID 42 is logged in.

The PHP equivalent to this would be:

REST Interface

The entrypoint you define in the extension-setup (default: /goto/) can be used as a Restful Interface API for creating, updating and deleting shortened URLs.

To enable this feature you need to go to the TYPO3 Backend and into the Settings Module and open the 'Configure Extensions' Dialog.

Here you open the configuration options of the 'shortcutlink' extension.

You will find a button 'generate a new API key'. Klick that Button and a new key will be generated. Make sure to copy it once it is generated, it can not be restored. Save the configuration after that.

This key can now be used for POST,PUT and DELETE operations by adding it as a header named 'ApiKey' to the HTTP Request header.

To create a new shortened url you will use the POST method without a key after /goto/

Here is an example with curl:

The response will be the shortlink URL as text/plain. For example:

Alternatively you can use a json-encoded string as payload, if you set the Content-type to application/json. The answer will still be text/plain though:

Possible fields in the payload are:

Possible return codes are:

To update a shortened url you would use the PUT method on the shortened URL. PUT supports like POST a json encoded and a query encoded payload.

for example:

The body will simply contain OK on an successfull update. If the shortened URL is locked to a user, the userid needs to be provided as well. Only the URL can be updated, not the user.

Possible return codes are:

The body will simply contain OK on an successfull delete.

Possible return codes are:

TODO: Documentation


All versions of shortlink with dependencies

PHP Build Version
Package Version
Requires php Version 7.4.* || 8.0.* || 8.1.*
typo3/cms-core Version 11.5.*
tuupola/base62 Version ^2.0.0
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 sudhaus7/shortlink contains the following files

Loading the files please wait ....