Copied!

SystemV shared memory based CacheItemPool implementation.

This CacheItemPool implementation can be used among multiple processes, but it doesn't provide any locking mechanism. If multiple processes write to this ItemPool, you have to avoid race condition manually in your code.

CloneableInstantiable
Constants
public Google\Auth\Cache\SysVCacheItemPool::DEFAULT_MEMSIZE = 10000
public Google\Auth\Cache\SysVCacheItemPool::DEFAULT_PERM = 384
public Google\Auth\Cache\SysVCacheItemPool::DEFAULT_PROJ = 'A'
public Google\Auth\Cache\SysVCacheItemPool::DEFAULT_SEM_PROJ = 'B'
public Google\Auth\Cache\SysVCacheItemPool::VAR_KEY = 1
Methods
public __construct( $options = [])
 

Create a SystemV shared memory based CacheItemPool.

  • param mixed[] $options { [optional] Configuration options.
    @type int    $variableKey The variable key for getting the data from the shared memory. **Defaults to** 1.
    @type string $proj        The project identifier for ftok. This needs to be a one character string.
                              **Defaults to** 'A'.
    @type string $semProj     The project identifier for ftok to provide to `sem_get`. This needs to be a one
                              character string.
                              **Defaults to** 'B'.
    @type int    $memsize     The memory size in bytes for shm_attach. **Defaults to** 10000.
    @type int    $perm        The permission for shm_attach. **Defaults to** 0600.
    
    }
public clear() : bool
 
    public commit() : bool
     
      public deleteItem( $key) : bool
       
        public deleteItems(array $keys) : bool
         
          public getItem( $key) : Psr\Cache\CacheItemInterface
           
          • param mixed $key
          • return \CacheItemInterface
          public getItems(array $keys = []) : iterable
           
          • param mixed[] $keys
          • return iterable<\CacheItemInterface>
          public hasItem( $key) : bool
           
            public save(Psr\Cache\CacheItemInterface $item) : bool
             
              public saveDeferred(Psr\Cache\CacheItemInterface $item) : bool
               
                Properties
                private $deferredItems = NULL
                 
                • var \CacheItemInterface[]
                private $hasLoadedItems = false
                 
                • var bool
                private $items = NULL
                 
                • var \CacheItemInterface[]
                private ?int $lockOwnerPid = NULL
                 

                Maintain the process which is currently holding the semaphore to prevent deadlock.

                • var int|null
                private $options = NULL
                 
                • var mixed[]
                private SysvSemaphore|false $semId = false
                 
                • var \SysvSemaphore|false
                private $sysvKey = NULL
                 
                • var int
                Methods
                private acquireLock() : bool
                private attachShm() : SysvSharedMemory|false
                private loadItems()
                 

                Load the items from the shared memory.

                • return bool true when success, false upon failure
                private releaseLock() : bool
                private resetShm() : void
                private saveCurrentItems()
                 

                Save the current items.

                • return bool true when success, false upon failure
                © 2026 Bruce Wells
                Search Namespaces \ Classes
                Configuration