key分析
@access protected
@param string $key
@return string
549351
protected function parseKey($key)
    {
        if (0 === strpos($key, '__TABLE__.')) {
            list($collection, $key) = explode('.', $key, 2);
        }

        if ('id' == $key && $this->connection->getConfig('pk_convert_id')) {
            $key = '_id';
        }

        return trim($key);
    }
1075976
protected function parseKey($key)
    {
        if (0 === strpos($key, '__TABLE__.')) {
            $tmp = explode('.', $key, 2);
            $key = isset($tmp[1]) ? $tmp[1] : null;
        }
        if ('id' == $key && $this->connection->getConfig('pk_convert_id')) {
            $key = '_id';
        }
        return trim($key);
    }
1077124
public function get(string $key)
    {
        $slug = $this->splitKey($key);

        if (is_string($slug)) {
            if (isset($this[$slug])) {
                return $this[$slug];
            }
            return null;
        }

        $array = $this->toArray();

        foreach ($slug as $search) {
            if (isset($array[$search])) {
                $array = $array[$search];
            } else {
                return;
            }
        }

        return $array;
    }
281046
private function getSectionFromKey($key)
    {
        $section = null;

        $parts = explode('.', $key);
        if (count($parts) > 1) {
            $section = $parts[0];
        }

        if (array_key_exists($section, $this->sectionMap)) {
            $section = $this->sectionMap[$section];
        }

        if (null === $section) {
            $section ='PHP';
        }

        return $section;
    }
513264
public function key($key)
    {
        if (!$key) {
            return false;
        }

        $prefix = '';
        if ($this->_groupPrefix) {
            $prefix = md5(implode('_', $this->groups()));
        }

        $key = preg_replace('/[\s]+/', '_', strtolower(trim(str_replace([DIRECTORY_SEPARATOR, '/', '.'], '_', (string)$key))));

        return $prefix . $key;
    }
1271234
private function splitToLast($key)
    {
        $split = explode($this->delimiter, $key);
        $key = implode($this->delimiter, array_slice($split, 0, -1));
        $last = end($split);

        return [$key, $last];
    }
1291233
public function getKey(string $key)
    {
        $keys = explode('.', $key);
        $file = array_shift($keys);
        $keys = explode('/', implode('.', $keys));

        if (!isset($this->translations[$file])) {
            $this->addFile($file);
        }

        return $this->findKey($file, $keys);
    }
1038516
protected function path($key)
	{
		$parts = explode('.', $key);

		$path = array_shift($parts);
		$path = $this->directory . ($path ? DIRECTORY_SEPARATOR . $this->cleanPath($path) : '');

		return $path . DIRECTORY_SEPARATOR . $this->id($key) . '.php';
	}
357501
private function getNestedValueByKey($key)
    {
        if (isset($this->nestedKeyCache[$key])) {
            return $this->nestedKeyCache[$key];
        }

        // Check to see if this is targeting an instance of ArrayContainer and grab it from the nested container
        $keyParts = explode('.', $key);
        if ($this->get($keyParts[0]) instanceof self && $arrayContainer = $this->get($keyParts[0])) {
            array_shift($keyParts);
            /* @var ArrayContainer $arrayContainer */
            $value = $arrayContainer->get(implode('.', $keyParts));
        } else {
            $value = $this->items;
            foreach (explode('.', $key) as $keyPart) {
                if ((! is_array($value) || ! $value instanceof self)) {
                    if (is_object($value) && method_exists($value, 'arrayAccessByKey')) {
                        if ($value = $value->arrayAccessByKey($keyPart)) {
                            break;
                        } else {
                            return null;
                        }
                    }
                }

                if (! isset($value[$keyPart])) {
                    return null;
                }

                if (is_array($value[$keyPart]) && ! array_key_exists($keyPart, $value)) {
                    return null;
                }
                $value = $value[$keyPart];
            }
        }

        $this->nestedKeyCache[$key] = $value;

        return $value;
    }
769953
private function makeKey($key)
    {
        return is_numeric($key) || strpos($key, '`') !== false || strpos($key, ' ') !== false || strpos($key, '.') ||
               strpos($key, ',') || strpos($key, '(')
            ? $key
            : '`' . $key . '`';
    }
581797
private static function formatParamsKey($key): string
    {
        if (\is_string($key) && \strpos($key, ':') === false) {
            return ':' . $key;
        }

        return $key;
    }
915436
protected function id($key)
	{
		$parts = explode('.', $key);
		$group = array_shift($parts);
		$name  = implode('.', $parts);

		$id = md5($this->options['client'] . '-' . $name . '-' . $this->options['language']);

		return $this->options['hash'] . '-cache-' . $group . '-' . $id;
	}
1354071
public function get($key) {
        $key = $this->secureKey($key);
        
        if (isset($_SESSION[$key])) {
            return trim(Text::unlock($_SESSION[$key], $this->sugar()));
        } else {
            return '';
        }
    }
475657
private static function stringifyKey($key): string
    {
        if ($key === null || is_scalar($key)) {
            return (string) $key;
        }

        if (is_object($key)) {
            return spl_object_hash($key);
        }

        return static::stringifyArrayKey($key);
    }
332514
public function group_by( $key ) 
	{
		if ( !is_array( $key ) )
		{
			$key = array( $key );	
		}
		
		foreach( $key as $group_key )
		{
			$this->groups[] = $group_key;
		}
		
		return $this;
	}
717547
public function isLast($key)
    {
        if (null === $this->lastKey) {
            end($this->hierarchy);
            $this->lastKey = key($this->hierarchy);
        }

        return $key === $this->lastKey;
    }
126855
public function getJson($key)
    {
        $signature = array();
        $signature['protected'] = self::base64Encode(Parser::encode($this->headers));
        $signature['payload']   = self::base64Encode($this->claim);
        $signature['signature'] = $this->getEncodedSignature($key);

        return Parser::encode($signature);
    }