Download the PHP package shlinkio/shlink-common without Composer

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

Shlink Common

Build Status Code Coverage Latest Stable Version License Paypal donate

This library provides some utils and conventions for web apps. It's main purpose is to be used on Shlink project, but any PHP project can take advantage.

Most of the elements it provides require a PSR-11 container, and it's easy to integrate on mezzio applications thanks to the ConfigProvider it includes.

Install

Install this library using composer:

composer require shlinkio/shlink-common

This library is also a mezzio module which provides its own ConfigProvider. Add it to your configuration to get everything automatically set up.

Cache

This library provides both PSR-6 and PSR-16 cache adapters, via symfony/cache.

They can be fetched via Psr\Cache\CacheItemPoolInterface and Psr\SimpleCache\CacheInterface.

The concrete implementation they return is different depending on your configuration:

The last two adapters will use the namespace defined in cache.namespace config entry.

The three of them will allow setting a default lifetime for those entries which do not explicitly define one, picking it up from cache.default_lifetime.

Redis support

You can allow caching to be done on a redis instance, redis cluster or redis sentinels, by defining some options under cache.redis config.

Note The entries in servers support credentials in the form of tcp://password@my-server:6379 or tcp://username:password@my-server:6379.

Redis publishing helper

Also, in order to support publishing in redis pub/sub, a RedisPublishingHelper service is provided, which will use the configuration above in order to connect to the redis instance/cluster.

Middlewares

This module provides a set of useful middlewares, all registered as services in the container:

Doctrine integration

Some doctrine-related services are provided, that can be customized via configuration:

EntityManager

The EntityManager service can be fetched using names em or Doctrine\ORM\EntityManager.

In any case, it will come decorated so that it is reopened automatically after having been closed.

The EntityManager can be customized using this configuration:

Connections

As well as the EntityManager, there are two Connection objects that can be fetched.

EntityRepository factory

In order to allow multiple repositories per entity, and also to avoid the $this->em->getRepository(MyEntity::class) pattern and instead "promote" injecting repositories, this library provides a EntityRepositoryFactory helper class that can be used like this.

Logger

A few logger-related helpers are provided by this library.

LoggerFactory

The LoggerFactory class is capable of creating Monolog\Logger instances wrapping either stream handlers or rotating file handlers, which should be defined under the logger config entry.

Every logger can have these config options:

Other logger utils

This module provides some other logger-related utilities:

HTTP Client

A guzzle HTTP client comes preregistered, under the GuzzleHttp\Client service name, and aliased by httpClient.

It can be customized by adding request and response middlewares using a configuration like this:

Middlewares can be registered as static callbacks with a signature like the one from the example or as service names which resolve to a service with that same signature.

Mercure

A helper to publish updates on a mercure hub comes preregistered. You need to provide a configuration like this one:

After that, you can get the publisher from the container, and invoke it to publish updates for specific topics:

Find more info about the symfony/mercure component here: https://symfony.com/blog/symfony-gets-real-time-push-capabilities

RabbitMQ

A helper to publish updates on RabbitMQ comes preregistered. You need to provide a configuration like this one:

After that, you can get the helper from the container, and invoke it to publish updates for specific queues:

Utils


All versions of shlink-common with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-fileinfo Version *
akrabat/ip-address-middleware Version ^2.3
cakephp/chronos Version ^3.1
doctrine/orm Version ^3.2
endroid/qr-code Version ^6.0 || ^5.0
fig/http-message-util Version ^1.1
guzzlehttp/guzzle Version ^7.9
laminas/laminas-config Version ^3.9
laminas/laminas-diactoros Version ^3.3
laminas/laminas-inputfilter Version ^2.30
laminas/laminas-servicemanager Version ^3.22
lcobucci/jwt Version ^5.3
monolog/monolog Version ^3.7
php-amqplib/php-amqplib Version ^3.7
predis/predis Version ^2.2
psr/http-server-middleware Version ^1.0
ramsey/uuid Version ^4.7
shlinkio/shlink-config Version ^3.3
shlinkio/shlink-json Version ^1.2
symfony/cache Version ^7.1
symfony/lock Version ^7.1
symfony/mercure Version ^0.6
symfony/string Version ^7.1
symfony/translation-contracts Version ^3.5
symfony/var-exporter Version ^7.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 shlinkio/shlink-common contains the following files

Loading the files please wait ....