read

@param string|int $id

@return  string
768798
public function read($id)
    {
        // Get the session data from the database table.
        $query = $this->db->getQuery(true);
        $query->select($this->db->quoteName($this->options['data_col']))
            ->from($this->db->quoteName($this->options['table']))
            ->where($this->db->quoteName($this->options['id_col']) . ' = ' . $this->db->quote($id));

        $this->db->setQuery($query);

        return (string) $this->db->loadResult();
    }
629309
public function read($id)
    {
        $session = $this->entityManager->find($this->entityManager, $id);
        if (null !== $session) {
            if ($this->_getExpirationTime($session) > time()) {
                return $session->{$this->dataColumn};
            } else {
                $this->destroy($id);
            }
        }

        return '';
    }
404083
public function read($id)
    {
        // Check if id exists
        if (!xcache_isset($this->prefix . $id)) {
            return false;
        }

        return (string) xcache_get($this->prefix . $id);
    }
551653
public function read(int $id, int &$offset = 0, bool $cleanup = true)
    {
        $this->logger->beginProfile('read_' . $id);
        $key    = $this->getSharedItemKey($id);
        $sh     = shmop_open($key, 'a', 0, 0);
        $header = shmop_read($sh, 0, self::HEADER_SIZE);
        list($id, $off, $size, $flags) = $this->unpackHeader($header);
        $this->logger->debug(sprintf('Reading state: (key = 0x%08x, shmid = %d)', $key, $sh));
        $this->logger->debug(sprintf("State header: (id = %d, offset = %d, size = 0x%08x, flags = 0x%03x)", $id,
            $offset,
            $size, $flags));

        $result = shmop_read($sh, self::HEADER_SIZE, $size);
        $this->logger->debug(sprintf('State data: (size = 0x%08x)', mb_strlen($result, 'utf-8')));
        if ($cleanup) {
            shmop_delete($sh);
        }

        shmop_close($sh);

        $result = $this->getResult($result, $flags);
        $offset = $off;

        $this->logger->endProfile('read_' . $id, "Reading {$id} data");

        return $result;
    }
1013000
public function read(string $id) :? array
    {
        static $stmt;
        if (!isset($stmt)) {
            $stmt = $this->pdo->prepare("SELECT * FROM cesession_session WHERE id = :id");
        }
        $stmt->execute(compact('id'));
        if ($data = $stmt->fetch(\PDO::FETCH_ASSOC)) {
            $this->exists = true;
            $data['data'] = base64_decode($data['data']);
            return $data;
        }
        $this->exists = false;
        return null;
    }
1302400
public function read($id)
    {
        $class = $this->getEntityClassFromType($this->apiRecordType);
        $entity = $this->getEntityManager()->find($class, $id);

        if (!$entity) {
            return new Response('', Response::HTTP_NOT_FOUND);
        }

        return new JsonResponse($this->getApiWriter()->writeObject($entity), Response::HTTP_CREATED);
    }
1247523
public function read($id) {
        $tmp      = $_SESSION;
        $key      = $this->getKey($id);
        $_SESSION = json_decode($this->mem->get($key, false, ''), true);


        // TODO: replace all of this with custom session data modifiers to be executed one by one
        // TODO: Create CachedSessionHandler that accepts AbstractStorage as its storage
        // TODO: Refactor this to extend CachedSessionHandler and use JSON encode/decode where needed
        $user = $this->getUser();

        if ($user instanceof UserInterface) {
            $roles = array();
            /** @var RoleInterface $role */
            foreach ($user->getRoles() as $role) {
                $roles[] = $role->getRole();
            }
            $userData         = array(
                'username' => $user->getUsername(),
                'roles'    => $roles
            );
            $_SESSION['user'] = $userData;
        }

        if (isset($_SESSION) && !empty($_SESSION) && $_SESSION != null) {
            $new_data = session_encode();
            $_SESSION = $tmp;
            return $new_data;
        }
        return '';
    }
149821
public function read($id) {
    $crypto = $this->psl['crypt/crypto'];
    $store  = $this->psl['store'];

    /* If no cookie is set, just drop it! */
    if(!isset($_COOKIE[$this->name])) {
      return false;
    }

    /* Read from store and decrypt. */
    try {
      $sessData = $store->read('session', $_COOKIE[$this->name]);

      if($sessData !== false ) {
        $return = $crypto->decrypt($sessData, $this->secret);
      } else {
        $return = false;
      }
      return $return;
    }  catch (\phpSec\Exception $e) {
      return false;
    }
  }
630121
public function read($id)
    {
        try {
            $result = $this->db->from($this->table)
                ->where($this->columns['id'])->eq($id)
                ->column($this->columns['data']);

            return $result === false ? '' : $result;
        } catch (PDOException $e) {
            return '';
        }
    }
31847
public function read($id)
    {
        $session = $this->getPersistence()->get(self::KEY_NAMESPACE.$id); 
        return is_string($session) ? $session : '';
    }
374893
public function _read($id) {
		$result = ORM::for_table($this->sessions_table)->findOne($id);
        return $result ? $result->data : '';
    }
218917
public function read($id) {
        if ($this->overrideAction('read', $id)) {
            return;
        }

        $this->Model->id = $id;

        $result = $this->AdminToolbar->getRecordById($this->Model, $id);

        if (!$result) {
            throw new NotFoundException(__d('admin', '%s Not Found', $this->Model->singularName));
        }

        $this->Model->set($result);
        $this->AdminToolbar->logAction(ActionLog::READ, $this->Model, $id);

        $this->AdminToolbar->setAssociationCounts($this->Model);

        $this->set('result', $result);
        $this->overrideView('read');
    }
712657
public function findById($id)
    {
        if (!array_key_exists($id, $this->bpmn2Files)) {
            return null;
        }

        $bpmn2Reader = new Bpmn2Reader();

        return $bpmn2Reader->read($this->bpmn2Files[$id]->getFile());
    }
876400
public function load($id)
    {

        try {
            return $this->unpersist($id);
        } catch (SessionDataNotReadableException $sdnre) {
            $this->delete($id);
        }
    }
357032
function read($id) {
		$this->sid=$id;
		if (!$data=$this->_cache->get($id.'.@'))
			return '';
		if ($data['ip']!=$this->_ip || $data['agent']!=$this->_agent) {
			$fw=Base::instance();
			if (!isset($this->onsuspect) ||
				$fw->call($this->onsuspect,[$this,$id])===FALSE) {
				//NB: `session_destroy` can't be called at that stage (`session_start` not completed)
				$this->destroy($id);
				$this->close();
				unset($fw->{'COOKIE.'.session_name()});
				$fw->error(403);
			}
		}
		return $data['data'];
	}
551399
public function show($id)
    {
        $content = $this->repository->getById($id);
        if (!empty($content)) {
            $this->authorize('read', $content);
            return $this->respondWithSuccess($content, new ContentTransformer);
        }
        return $this->respondNotFound();
    }
136872
public function fetchById($id)
    {
        $data = $this->getRequest()->getContents($this->getKey(), $id);
        return $data;
    }