• Час читання ~1 хв
  • 11.07.2023

Пакет кешу Roadrunner KV для Laravel дозволяє працювати з плагіном RoadRunner Key-Value як драйвер кешу:

use Illuminate\Support\Facades\Cache;

// Default main store - rr-memory
Cache::driver()->get('key');

// rr-boltdb store
Cache::driver('rr-boltdb')->get('key');

плагін Key-Value дозволяє зберігати довільні дані всередині RoadRunner між різними HTTP-запитами або іншими типами додатків, такими як CLI.

Завдяки Roadrunner цей пакет підтримує сховище в пам'яті та драйвер, boltdb якщо вам потрібне постійне зберігання. Він також підтримує наскрізно зашифровану серіалізацію, якщо у вас є дані, які можуть містити конфіденційну інформацію, наприклад, особисті дані користувача.

Як і будь-який драйвер кешу, ви можете налаштувати кілька параметрів за допомогою драйвера ключа-значення RoadRunner. Ось кілька прикладів параметрів конфігурації з прикладів конфігурації кешу в readme:

<?php
return [
    'default' => 'rr-memory', // Default store (optional)

    'stores' => [
        'rr-memory' => [ // Custom store name with "memory" connection
            'driver' => 'roadrunner',
            'connection' => 'memory', // section name from KV plugin settings in RoadRunner config file (.rr.yaml)
            'serializer' => null, // Available options: null|igbinary
            'encryption_key' => null, // Available options: null|string
        ],
        'rr-memory-igbinary-encrypted' => [ // Custom store name with "memory" connection and encrypted "igbinary" serializer
            'driver' => 'roadrunner',
            'connection' => 'memory', // section name from KV plugin settings in RoadRunner config file (.rr.yaml)
            'serializer' => 'igbinary', // Available options: null|igbinary
            'encryption_key' => 'key1', // Available options: null|string
        ],
         'rr-memory-encrypted' => [ // Custom store name with "memory" connection and encrypted serializer
            'driver' => 'roadrunner',
            'connection' => 'memory', // section name from KV plugin settings in RoadRunner config file (.rr.yaml)
            'serializer' => null, // Available options: null|igbinary
            'encryption_key' => 'key2', // Available options: null|string
        ],
    ],
],

Ви можете дізнатися більше про цей пакет, отримати повні інструкції зі встановлення та переглянути вихідний код на GitHub.

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

Про мене

Professional Fullstack Developer with extensive experience in website and desktop application development. Proficient in a wide range of tools and technologies, including Bootstrap, Tailwind, HTML5, CSS3, PUG, JavaScript, Alpine.js, jQuery, PHP, MODX, and Node.js. Skilled in website development using Symfony, MODX, and Laravel. Experience: Contributed to the development and translation of MODX3 i...

Про автора CrazyBoy49z
WORK EXPERIENCE
Контакти
Ukraine, Lutsk
+380979856297