Get cached value

@global stdClass $CFG
@global stdClass $USER
@param mixed $param
@return bool|string
432681
public function get($param) {
        global $CFG, $USER;
        $this->cleanup($this->ttl);
        $filename = 'u'.$USER->id.'_'.md5(serialize($param));
        if(file_exists($this->dir.$filename)) {
            $lasttime = filemtime($this->dir.$filename);
            if (time()-$lasttime > $this->ttl) {
                return false;
            } else {
                $fp = fopen($this->dir.$filename, 'r');
                $size = filesize($this->dir.$filename);
                $content = fread($fp, $size);
                return unserialize($content);
            }
        }
        return false;
    }
1081814
public function get($name, $param, $meta = false)
	{
		$fileDir = $this->cache . '/' . $name;
		$filePath = $fileDir . '/' . $param . '.json';
		if(!is_file($filePath))
		{
			return null;
		}
		$object = json_decode(file_get_contents($filePath), true);
		if($meta)
		{
			return $object;
		}
		return $object['data'];
	}
202447
public static function getInstance($cfg) {
        if (extension_loaded('memcached')) {
            try {
                $servers = $cfg->get('memcached');
                if ($servers) {
                    $memcache = new \Memcached ();
                    $memcache->setOption(\Memcached::OPT_CONNECT_TIMEOUT, 3);
                    $memcache->setOption(\Memcached::OPT_DISTRIBUTION, \Memcached::DISTRIBUTION_CONSISTENT);
                    $memcache->setOption(\Memcached::OPT_SERVER_FAILURE_LIMIT, 2);
                    $memcache->setOption(\Memcached::OPT_REMOVE_FAILED_SERVERS, true);
                    $memcache->setOption(\Memcached::OPT_RETRY_TIMEOUT, 1);
                    if (extension_loaded('igbinary') && defined('MEMCACHED_USE_IGBINARY')) {
                        $memcache->setOption(\Memcached::OPT_SERIALIZER, \Memcached::SERIALIZER_IGBINARY);
                    }
                    if ($memcache->addServers($servers)) {
                        return new MemcachedCache($memcache);
                    }
                }
            } catch (\Exception $e) {
                log_error($e->getMessage(), 'cache_memcached');
            }
        }

        return null;
    }
687661
public function getOobCode($param) {
    $response = $this->invokeGitkitApiWithServiceAccount(
        'getOobConfirmationCode', $param);
    if (isset($response['oobCode'])) {
      return $response['oobCode'];
    } else {
      throw new Gitkit_ClientException("can not get oob-code");
    }
  }
867567
public function set_by_option(string $id_option, array $cfg): int
  {
    if ( $id = $this->retrieve_user_ids($id_option, $this->id_user) ){
      return $this->set($id[0], $cfg);
    }
    return $this->_insert($id_option, $cfg);
  }
1129567
public function getParam(string $param)
    {
        if (! empty($this->match['params'][$param])) {
            return $this->match['params'][$param];
        }
    }
753450
public static function get_context_data(\context $context, \stdClass $user) : \stdClass {
        global $DB;

        $basedata = (object) [];
        if ($context instanceof \context_module) {
            return static::get_context_module_data($context, $user);
        }
        if ($context instanceof \context_block) {
            return static::get_context_block_data($context, $user);
        }

        return $basedata;
    }
1124183
public static function getMixedValue(array $data, $param)
    {
        $casted = self::castToArray($param);

        $data['model'] = $param;

        foreach ($data as $key => $value) {
            if (isset($casted[$key])) {
                $data[$key] = $casted[$key];
            }
        }

        return $data;
    }
172765
protected function getParam($param = null, $defaultValue = null)
    {
        $request = $this->getRequest();
        if ($param === null) {
            return array_merge($request->getQuery(), $request->getParams());
        }

        $value = $request->getParam($param);
        if ($value === null) {
            return $request->getQuery($param, $defaultValue);
        }

        return $value;
    }
992605
protected function resolveArgumentValue(\ReflectionParameter $param)
    {
        $paramClass = null;

        try {
            $paramClass = $param->getClass();
        }
        catch (\ReflectionException $e) {
        }

        if (!($paramClass instanceof ReflectionClass) || $param->isDefaultValueAvailable()) {
            return $this->resolveArgumentDefaultValue($param);
        }

        if (!($this->manager instanceof Manager)) {
            throw new RuntimeException("Unable to retrieve descriptor for class '{$paramClass->getName(
                                       )}' " . "because the manager has not been set. Please use Descriptor::setManager to resolve this.");
        }

        return $this->manager->describe($paramClass->getName(), null, null, $paramClass);
    }
1309986
public function get($param = '') {
        $this->validate();

        if ($param) {
            if (array_key_exists($param, $this->config)) {
                return $this->config[$param];
            }
            else {
                throw new OptionConfigException('option param not valid: ' . $param);
            }
        }

        return $this->config;
    }
1193401
public function load($param = null)
    {

        $configSet = $this->_getConfigSet();

        if (0 === count($configSet)) {
            // set default config set for the default execution
            $configSet = [
                realpath(
                    "{$this->config_path}/{$this->get(self::HIERARCHY_PLACEHOLDER_INDEX)}"
                    . (string) self::CONFIG_DELIMITER
                    . (string) self::FILE_EXTENSION
                )
            ];
            $this->set('config_set', $configSet);
        }

        return $this->populateEngine(
            $this->checkConfigForDefaultConfig($configSet)
        );
    }
1315353
public function getFilterValue($param = null)
    {
        //iteracja po filtrach w gridzie
        foreach ($this->_grid->getState()->getFilters() as $filter) {
            //znaleziony filtr dla tego pola z tabelą
            if ($filter->getTableName() . '.' . $filter->getField() == $this->getName()) {
                //zwrot wartości filtra
                return $filter->getValue();
            }
            //znaleziony filtr dla tego pola (bez tabeli)
            if (!$filter->getTableName() && $filter->getField() == $this->getName()) {
                /** @var \stdClass $value */
                $valueObj = json_decode($filter->getValue());
                if (null !== $param && is_object($valueObj) && property_exists($valueObj, $param)) {
                    return $valueObj->{$param};
                }
                //zwrot wartości filtra
                return $filter->getValue();
            }
        }
    }
935098
public function get($param, $defaultValue = null)
    {
        return array_key_exists($param, $this->config) ? $this->config[$param] : $defaultValue;
    }
564953
public function getCardProvider($param)
    {
        $this->flushState();
        $isValidProvider = CheckoutApi_Client_Validation_GW3::isProvider($param);
        $uri = $this->getUriProvider().'/cards';
        $hasError = false;
        if(!$isValidProvider)
        {
            $hasError = true;
            $this->throwException('Please provide a valid provider id',array('param'=>$param));
        }

        if(!$hasError){
            $uri = "{$uri}/{$param['providerId']}";
        }

        return $this->request( $uri ,$param,!$hasError);
    }
1023005
public static function getInstance($cfg = array())
    {
        if (!isset(self::$instance)) {
            $className = __CLASS__;
            // self::$instance set in __construct
            new $className($cfg);
        } elseif ($cfg) {
            self::$instance->setCfg($cfg);
        }
        return self::$instance;
    }
261170
public function load($param = null)
    {
        // if there already has been a config set it means it already
        // has been loaded so why bother retrying ! this is not a dynamic language !
        $configSet = $this->get('config_set');
        if (count((array) $configSet) > 0) return true;

        // if the config set already exists don't parse it
        if (empty($configSet) && !($configSet = $this->_getConfigSet())) {
            // set default config set for the default execution
            $configSet = [
                realpath("{$this->config_path}/" . (string)self::HIERACHY_PLACEHOLDER . (string)self::CONFIG_DELIMITER . (string)self::FILE_EXTENSION)
            ];
            $this->set('config_set', $configSet);
        }

        /**
         * create the total config parameter array and merge it recursive
         */
        try {
            if (empty($configSet) || !is_readable($configSet[0])) {
                throw new ConfigException("No default config file declared {$this->config_path}/" . self::HIERACHY_PLACEHOLDER . (string)self::CONFIG_DELIMITER . (string)self::FILE_EXTENSION);
            }

            $configParser = new \chilimatic\lib\config\configfile\Parser();
            // first insert point
            $node = null;
            foreach ($configSet as $config) {
                /**
                 * get the key for the config node
                 */
                $key = explode('/', $config);
                $key = substr(array_pop($key), 0, -4);

                $node = new Node($this->mainNode, $key, $config, 'self');
                $this->lastNewNode = $node;
                // add the config node
                $this->mainNode->addChild($node);

                unset($key);
                $configParser->parse($this->getConfigFileContent($config), $node);
            }

        } catch (ConfigException $e) {
            throw $e;
        }

        return true;
    }