dolibarr  20.0.0-alpha
Functions
memory.lib.php File Reference

Set of function for memory/cache management. More...

Go to the source code of this file.

Functions

 dol_setcache ($memoryid, $data, $expire=0)
 Save data into a memory area shared by all users, all sessions on server. More...
 
 dol_getcache ($memoryid)
 Read a memory area shared by all users, all sessions on server. More...
 
 dol_getshmopaddress ($memoryid)
 Return shared memory address used to store dataset with key memoryid. More...
 
 dol_listshmop ()
 Return list of contents of all memory area shared. More...
 
 dol_setshmop ($memoryid, $data, $expire)
 Save data into a memory area shared by all users, all sessions on server. More...
 
 dol_getshmop ($memoryid)
 Read a memory area shared by all users, all sessions on server. More...
 

Detailed Description

Set of function for memory/cache management.

Definition in file memory.lib.php.

Function Documentation

◆ dol_getcache()

dol_getcache (   $memoryid)

Read a memory area shared by all users, all sessions on server.

Parameters
string$memoryidMemory id of shared area
Returns
int|mixed Return integer <0 if KO, data if OK, null if not found into cache or no caching feature enabled
See also
dol_setcache()

Definition at line 141 of file memory.lib.php.

◆ dol_getshmop()

dol_getshmop (   $memoryid)

Read a memory area shared by all users, all sessions on server.

Parameters
string$memoryidMemory id of shared area ('main', 'agenda', ...)
Returns
int|null Return integer <0 if KO, data if OK, null if no cache enabled or not found

Definition at line 294 of file memory.lib.php.

◆ dol_getshmopaddress()

dol_getshmopaddress (   $memoryid)

Return shared memory address used to store dataset with key memoryid.

Parameters
string$memoryidMemory id of shared area ('main', 'agenda', ...)
Returns
int Return integer <0 if KO, Memoy address of shared memory for key

Definition at line 220 of file memory.lib.php.

◆ dol_listshmop()

dol_listshmop ( )

Return list of contents of all memory area shared.

Returns
array

Definition at line 234 of file memory.lib.php.

◆ dol_setcache()

dol_setcache (   $memoryid,
  $data,
  $expire = 0 
)

Save data into a memory area shared by all users, all sessions on server.

Note: MAIN_CACHE_COUNT must be set.

Parameters
string$memoryidMemory id of shared area
mixed$dataData to save. It must not be a null value.
int$expirettl in seconds, 0 never expire
Returns
int Return integer <0 if KO, 0 if nothing is done, Nb of bytes written if OK
See also
dol_getcache()

Definition at line 69 of file memory.lib.php.

◆ dol_setshmop()

dol_setshmop (   $memoryid,
  $data,
  $expire 
)

Save data into a memory area shared by all users, all sessions on server.

Parameters
int$memoryidMemory id of shared area ('main', 'agenda', ...)
string$dataData to save. Must be a not null value.
int$expirettl in seconds, 0 never expire
Returns
int Return integer <0 if KO, 0=Caching not available, Nb of bytes written if OK

Definition at line 256 of file memory.lib.php.