X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=libcbfwr%2Fcomms.php;h=8e7ed3274ce8dce9096193b84311fffcdff34132;hp=a11f9b3750bf1db3cc73b56eca82f6d0e6c7663e;hb=c6a0d901040bc483d89d8596661dcf0d5a48ffb2;hpb=0f5458e4a9c18595f7d9501880011369e4e65942 diff --git a/libcbfwr/comms.php b/libcbfwr/comms.php index a11f9b3..8e7ed32 100644 --- a/libcbfwr/comms.php +++ b/libcbfwr/comms.php @@ -1,11 +1,12 @@ semres); - $shm_space = shm_attach($STORE_KEY, 16*1024*1024); + $shm_space = shm_attach($STORE_KEY, $CONF_STORE_SIZE); $config = shm_get_var($shm_space, $type); sem_release($this->semres); @@ -36,16 +37,26 @@ class Comms { sem_release($this->semres); } + function deleteConfig($type) + { + global $MESSAGE_KEY, $LOCKING_KEY, $STORE_KEY, $CONF_STORE_SIZE; + $shm_space = shm_attach($STORE_KEY, $CONF_STORE_SIZE); + + shm_remove_var($shm_space, $type); + } // type = 0 for the fs config // type = 1 for the boot hardware config // type = 2 for running config // type = 3 for web config + + // type = 4 for merged running config cache + // type = 5 for merged web config cache function putConfig($config, $type=0) { - global $MESSAGE_KEY, $LOCKING_KEY, $STORE_KEY; + global $MESSAGE_KEY, $LOCKING_KEY, $STORE_KEY, $CONF_STORE_SIZE; sem_acquire($this->semres); - $shm_space = shm_attach($STORE_KEY, 16*1024*1024); + $shm_space = shm_attach($STORE_KEY, $CONF_STORE_SIZE); shm_put_var($shm_space, $type, $config); sem_release($this->semres); }