Download the PHP package sanchescom/laravel-cache-memory without Composer

On this page you can find all versions of the php package sanchescom/laravel-cache-memory. 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-cache-memory

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.

Locks and semaphores are used to ensure atomic access so that multiple PHP processes can concurrently use the same shared memory safely.

Installing

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

Laravel 5.x:

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

Lumen:

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

Configuration

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

Put data to memory in one process

Get it from another process

About memory limits

Garbage collection (by removing expired items) will be performed when the cache is near the size limit. If the garbage collection fails to reduce the size of the cache below the size limit, then the cache will be invalidated and the underlying memory segment is marked for deletion.

Running out of memory will generate a warning or a notice in your logs, no matter if it is resolved by a garbage collection or by segment deletion.

Note: items that are stored as "forever" may be removed when the cache reaches its size limit.

Recreating the memory block

When recreating the memory block, the newest size limit defined in the Laravel config file will be used.

Manually marking the memory segment for deletion

There are use cases to this, such as wanting to refresh the memory block now instead of waiting for another "out of memory" event. In this case, you may do the following:

This usage will not trigger any warnings or notices since this is an action taken deliberately.


All versions of laravel-cache-memory with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
ext-shmop Version *
ext-sysvsem Version *
illuminate/support Version ^8.0|^9.0|^10.0
illuminate/cache Version ^8.0|^9.0|^10.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 sanchescom/laravel-cache-memory contains the following files

Loading the files please wait ....