- GLOBAL $sess;
-
- // error_log("User::load_data BEGIN", 0);
-
- $doexit = FALSE;
- do {
- if (($tok = @ftok(FTOK_PATH."/user".$id, "B")) == -1) {
- log_main("ftok failed");
- $doexit = TRUE;
- break;
- }
-
- if (($shm_sz = sharedmem_sz($tok)) == -1) {
- log_main("shmop_open failed");
- }
-
- if ($shm_sz == -1)
- $shm_sz = SHM_DIMS_U_MIN;
-
- if ($shm = shm_attach($tok, $shm_sz)) {
- $user = @shm_get_var($shm, $tok);
-
- log_only("bri == ".($user == FALSE ? "FALSE" : "TRUE")." bri === ".($user === FALSE ? "FALSE" : "TRUE")." bri isset ".(isset($user) ? "TRUE" : "FALSE"));
- if (isset($user))
- log_only("bri count ".count($user));
-
- if ($user == FALSE) {
- log_only("INIT MAIN DATA");
-
- // SHSPLIT FIXME: init_data for User class ??
- $user =& User::create($id, "", "");
- if (@shm_put_var($shm, $tok, $user) == FALSE) {
- log_only("PUT_VAR FALLITA ".strlen(serialize($user)));
- log_only(serialize($user));
- }
- }
-
- $user->shm_sz = $shm_sz;
-
- shm_detach($shm);
- }