Skip to content

sanchescom/laravel-cache-memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel Cache Memory

Laravel cache memory driver which use shared memory functions.

Shmop is an easy to use set of functions that allows PHP to read, write, create and delete Unix shared memory segments.

Shared memory an IPC1 mechanism native to UNIX. In essence, it’s about two processes sharing a common segment of memory that they can both read to and write from to communicate with one another.

Installing

Require this package, with Composer, in the root directory of your project.

$ composer require sanchescom/laravel-cache-memory

Laravel 5.x:

After updating composer, add the ServiceProvider to the providers array in config/app.php

'providers' => [
   ...
   Sanchescom\Cache\CacheServiceProvider::class,
],

Lumen:

After updating composer add the following lines to register provider in bootstrap/app.php

$app->register(Sanchescom\Cache\CacheServiceProvider::class);

Configuration

Put new driver in config/cache.php and set key and size for memory:

    'memory' => [
        'driver' => 'memory',
        'key' => env('MEMORY_BLOCK_KEY', 1),
        'size' => env('MEMORY_BLOCK_SIZE', 900000),
    ],

Put data to memory in one process

<?php

use Illuminate\Support\Facades\Cache;

Cache::store('memory')->put('some_key', ['value' => 'text']);

Get it from another process

<?php

use Illuminate\Support\Facades\Cache;

$data = Cache::store('memory')->get('some_key');

About

Laravel cache memory driver which use shared memory functions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy