Load a specific profile

@param  string $key

@return void
969381
protected function loadProfileByKey($key)
    {
        if (isset($this->profiles['profiles'][$key])) {
            $profile = $this->profiles['profiles'][$key];

            if (is_array($profile)) {
                $this->mergeProfileWithConfig($profile);
            }
        }
    }
1214802
protected function loadEmbed($key)
    {
        $attrs = $this->getAttrs();
        $embed = $attrs[$key];
        $cache = &$this->_cache;

        if (isset($this->cleanData[$key])) {
            $value = $this->cleanData[$key];
        } else {
            $value = null;
        }

        $model = $embed['model'];
        $type = $embed['type'];
        if ( isset($cache[$key]) ) {
            $obj = &$cache[$key];

            return $obj;
        } else {
            if (class_exists($model)) {
                if ($type == self::DATA_TYPE_EMBED) {
                    if ($value) {
                        $data = $value;
                        $object = new $model($data);
                        $object->embed = true;
                        $cache[$key] = $object;

                        return $object;
                    }

                    return null;
                } elseif ($type == self::DATA_TYPE_EMBEDS) {
                    $res = array();
                    if (!empty($value)) {
                        foreach ($value as $item) {
                            $data = $item;
                            $record = new $model($data);
                            $record->embed = true;
                            if ($record) {
                                $res[] = $record;
                            }
                        }
                    }
                    $set =  Collection::make($res);
                    $cache[$key] = $set;
                    $obj = &$cache[$key];

                    return $obj;
                }
            }
        }
    }
380641
public function load($key)
    {
        $data = $this->adapter->getItem($key, $success);

        if ($success && $this->automaticSerialization) {
            $data = unserialize($data);
            
            if ($data === false) {
                $this->remove($key);
            }
        }

        return $data;
    }
737554
public function read($key)
    {
        $this->_cachedData or $this->_cachedData = Cache::get('model-metadata');
        return isset($this->_cachedData[$key]) ? $this->_cachedData[$key] : null;
    }
906137
public function loadFromConfig($key)
    {
        $items = new IlluminateCollection(config()->get($key, []));

        if ($items->isEmpty()) return $this;

        $allHasConfig = $items->every(function ($item) {
            return config()->has($item);
        });

        if ($allHasConfig) {
            $items->each(function ($item) {
                $this->loadFromConfig($item);
            });

            return $this;
        }

        return $this->add($items->toArray());
    }
239644
public function setKey($key)
    {
        $this->key = $key;
        $this->driver->setNamespace($this->key);
    }
351308
public function end(string $key): void
    {
        if (!isset($this->profiles[$key])) {
            throw new InvalidKeyException("Could not find a profile with given '{$key}' key!");
        }

        $end = microtime(true);
        switch ($key) {
            case 'connection':
                $this->profiles['connection']['end'] = $end;
                $this->profiles['connection']['time'] = round($end - $this->profiles['connection']['start'], 10);
                break;
            case 'query':
                $i = $this->queryCount;
                if (isset($this->profiles['query'][$i])) {
                    $this->profiles['query'][$i]['end'] = $end;
                    $this->profiles['query'][$i]['time'] = round($end - $this->profiles['query'][$i]['start'], 10);
                }
                break;
            default:
                throw new InvalidKeyException("Unimplemented key '{$key}' given, available keys are"
                    ." 'connection,query' only!");
        }
    }
1041761
public function load($key)
    {
        if (file_exists($path = $this->path . $key)) {
            return unserialize(file_get_contents($path));
        }

        return null;
    }
535157
public function load($key)
    {
        //próba odczytu pliku
        try {
            return file_get_contents($this->_cache->getConfig()->path . '/' . $key);
        } catch (KernelException $e) {
            //brak akcji
        }
    }
897158
public function loadByKey($key)
    {
        $configuration = new Configuration();
        require $key;
        $vars = get_defined_vars();
        unset($vars['configuration']);
        unset($vars['key']);
        foreach ($vars as $name => $value) {
            $configuration->{$name} = $value;
        }

        return $configuration;
    }
875921
public function load($key, &$loaded) {
    $file = $this->getFile($this->getKey($key));
    if ($this->validate($file)) {
      $loaded = TRUE;
      
      return $this->direct ? $file : $file->getContents();
    }
    $loaded = FALSE;
  }
86878
static public function start( $name )
    {
        if ( !ObjectManager::getInstance()->get( Config::class )->getValue( 'profile' ) ) {
            return;
        }

        if ( !isset( self::$profileNames[$name] ) ) {
            self::$profileNames[$name] = 0;
        }
        $realName = $name . '_' . self::$profileNames[$name] ++;
        array_push( self::$currentProfileNames, $realName );

        self::$profiles[implode( self::PATH_SEPARATOR, self::$currentProfileNames )] = [
            'start_at' => microtime( true ),
            'start_used_memory' => memory_get_usage()
        ];
    }
1012222
private function loadFileContentPhaseOne($key)
    {
        // Settings from config
        $basepath = $this->config["basePath"];
        $filter   = $this->config["textfilter-frontmatter"];

        // Whole path to file
        $path = $basepath . "/" . $this->index[$key]["file"];

        // Load content from file
        if (!is_file($path)) {
            $msg = t("The content '!ROUTE' does not exists as a file '!FILE'.", ["!ROUTE" => $key, "!FILE" => $path]);
            throw new \Anax\Exception\NotFoundException($msg);
        }

        // Get filtered content
        $src = file_get_contents($path);
        $filtered = $this->di->get("textfilter")->parse($src, $filter);

        return $filtered;
    }
466039
private function read($key)
    {
        $fname = $this->getObjectPath($key);
        if (file_exists($fname)) {
            $content = file_get_contents($fname);
            return unserialize($content);
        }
        return null;
    }
297813
public function get(string $key)
    {
        $key = $this->hashKey($key);
        if (\array_key_exists($key, $this->cache)) {
            $this->hits++;
            return $this->cache[$key];
        }
        $this->misses++;
        return null;
    }
745407
public function retrieve($key)
    {
        $key = (string)$key;
        if ($cache = $this->loadCache()) {
            if (isset($cache[$key])) {
                if (!$this->isExpired($cache[$key]['time'], $cache[$key]['expire'])) {
                    return unserialize($cache[$key]['data']);
                }
            }
        }
        return null;
    }
604677
public function initKey($key)
    {
        if (!isset($_SESSION[self::SCOPE_KEY])) {
            $_SESSION[self::SCOPE_KEY] = array();
        }
        if (!isset($_SESSION[self::SCOPE_KEY][$key])) {
            $_SESSION[self::SCOPE_KEY][$key] = array();
        }
    }