Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cgmartin/simplememoryshared
ZF2 module v1.3 - Provide a manager to share simply memory, short or long message with Memcached, Segment memory, file system, etc. - This module can be used with my ForkManager
https://github.com/cgmartin/simplememoryshared
Last synced: 2 days ago
JSON representation
ZF2 module v1.3 - Provide a manager to share simply memory, short or long message with Memcached, Segment memory, file system, etc. - This module can be used with my ForkManager
- Host: GitHub
- URL: https://github.com/cgmartin/simplememoryshared
- Owner: cgmartin
- Created: 2012-11-27T02:38:36.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2012-11-27T03:13:49.000Z (about 12 years ago)
- Last Synced: 2023-03-12T04:11:54.727Z (almost 2 years ago)
- Language: PHP
- Homepage:
- Size: 112 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ZF2 SimpleMemoryShared module
============Version 1.3 Created by [Vincent Blanchon](http://developpeur-zend-framework.fr/)
Introduction
------------ZF2 module SimpleMemoryShared provide a memory shared manager.
This module can be used alone or with the [ParallelJobs](https://github.com/blanchonvincent/ParallelJobs) module.You can use this module within yours simply to have a simple memory manager.
Storage available are : file, segment, memcached and apc.Memory shared manager usage
------------1) Simple share with memory segment for short datas :
```php
getServiceLocator()->get('MemorySharedManager');
$manager->setStorage('segment');
$manager->write('1', 'secret');// in other process, you can do
$value = $manager->read('1');
```2) Simple share with plugin controller :
```php
memoryShared('segment')->write('1', 'secret');// in other process, you can do
$value = $this->memoryShared()->read('1');
```3) Share object with file storage :
```php
getServiceLocator()->get('MemorySharedManager');
$manager->setStorage('file');
$manager->write('my-identifier', new MyObject());// in other process, you can do
$object = $manager->read('my-identifier');
```4) Share object with memcached storage :
```php
getServiceLocator()->get('MemorySharedManager');
$manager->setStorage('memcached', array('host' => '127.0.0.1', 'port' => 11211));
$manager->write('my-identifier', new MyObject());// in other process, you can do
$object = $manager->read('my-identifier');
```