Download the PHP package mpyw/laravel-cached-database-stickiness without Composer

On this page you can find all versions of the php package mpyw/laravel-cached-database-stickiness. 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 laravel-cached-database-stickiness

Laravel Cached Database Stickiness
Build Status Coverage Status Scrutinizer Code Quality

Guarantee database stickiness over the same user's consecutive requests.

Requirements

Installing

[!IMPORTANT] The default implementation is provided by ConnectionServiceProvider, however, package discovery is not available. Be careful that you MUST register it in config/app.php by yourself.

Then select the proper cache driver:

Driver Is eligible? Description
redis 😄 Very fast, scalable and reliable driver
(Cluster mode must be disabled)
memcached 😄 Alternative for Redis
dynamodb 😧 It works but not so suitable for short-term caching
(ConsistentRead must be enabled)
apc 😧 It works unless PHP processes are running in multiple machines or containers
file 😧 It works unless PHP processes are running in multiple machines or containers
database 🤮 We'll get into a chicken-or-egg situation
array 🤮 Just for testing

Features

This library provides the following features.

Diagrams

Default

Sticky

Sticky Cached

Advanced Usage

Customize Stickiness TTL

[!NOTE] The default stickiness TTL is 5 seconds.
You can configure this value to add stickiness_ttl directive to your config/database.php.

Customize Connection Implementation

[!TIP] You can configure Connection implementation.

  • Make sure ConnectionServiceProvider to be removed from config/app.php.
  • Extend Connection with DispatchesConnectionEvents trait by yourself.

Customize Stickiness Source

[!TIP] You can register the StickinessResolverInterface implementation to change the source for stickiness determination.

Source Middleware
IpBasedResolver
(Default)
Remote IP address
AuthBasedResolver Authenticated User ID Required

[!IMPORTANT] You must add ResolveStickinessOnResolvedConnections middleware after Authenticate when you use AuthBasedResolver.

Customize Worker Behavior

[!TIP] You can register the JobInitializerInterface implementation to change workers' behavior.

General Queueable ShouldAssumeFresh Queueable ShouldAssumeModified Queueable
AlwaysModifiedInitializer
(Default)
Master Slave Master
AlwaysFreshInitializer Slave Slave Master

Attention

[!CAUTION]

Don't call Schema::defaultStringLength() in ServiceProvider::boot()

Problem

Assume that you have the following ServiceProvider.

If you run composer install or directly call php artisan pacakge:discover, it will unexpectedly use caches. It will trigger errors when we execute the command in the environment unreachable to the cache repository.

Solution

Directly use Illuminate\Database\Schema\Builder. Don't call via Illuminate\Support\Facades\Schema Facade.


All versions of laravel-cached-database-stickiness with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-pdo Version *
illuminate/container Version ^9.0 || ^10.0 || ^11.0
illuminate/contracts Version ^9.0 || ^10.0 || ^11.0
illuminate/database Version ^9.0 || ^10.0 || ^11.0
illuminate/queue Version ^9.0 || ^10.0 || ^11.0
illuminate/support Version ^9.0 || ^10.0 || ^11.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 mpyw/laravel-cached-database-stickiness contains the following files

Loading the files please wait ....