Loads a json schema.

@param string $path

@return \stdClass
179606
public function loadSchema($path)
    {
        $schema = Utils::LoadJsonFromFile($path);

        $hook = function ($uri) {
            return $this->resolveRef($uri);
        };

        //this is the resolution of the $ref thingy with Jval classes
        //resolver can take a Closure parameter to change the $ref value
        $resolver = new Resolver();
        $resolver->setPreFetchHook($hook);
        $walker = new Walker(new Registry(), $resolver);
        $schema = $walker->resolveReferences($schema, new Uri(''));

        return $walker->parseSchema($schema, new Context());
    }
448141
public function get($path)
    {
        if (false === $json = $this->runRequest($path, 'GET')) {
            return false;
        }

        return $this->decode($json);
    }
336223
def load_schema(schema_path):
    
    try:
        with open(schema_path) as schema_file:
            schema = json.load(schema_file)
    except ValueError as e:
        raise SchemaInvalidError('Invalid JSON in schema or included schema: '
                                 '%s\n%s' % (schema_file.name, str(e)))

    return schema
461918
protected function loadPath($path) {
        if (directory_exists($path)) {
            return $this->loadDirectory($path);
        } else if (file_exists($path)) {
            return $this->loadFile($path);
        }

        return [];
    }
1329855
public function parse($path)
	{
		$data = json_decode(file_get_contents($path), true);

		if (function_exists('json_last_error_msg'))
		{
			$error_message = json_last_error_msg();
		}
		else
		{
			$error_message  = 'Syntax error';
		}

		if (json_last_error() !== JSON_ERROR_NONE)
		{
			$error = array(
				'message' => $error_message,
				'type'    => json_last_error(),
				'file'    => $path,
			);
			throw new ParseException($error);
		}

		return $data;
	}
352353
private function loadFromPath(string $path): self
    {
        switch ($this->extension) {
            case self::FORMAT_JPEG:
                $this->createFromJpeg($path);
                break;
            case self::FORMAT_PNG:
                $this->createFromPng($path);
                break;
            case self::FORMAT_GIF:
                $this->createFromGif($path);
                break;
            case self::FORMAT_WD_IMAGE:
                $this->createFromEncrypted($path);
                break;
            default:
                throw new ImageException('This image format is not supported!');
        }
        return $this;
    }
1085174
public function load($path)
    {
        $path = $this->findAbsolutePath($path);
        $hash = Yaml::parse(file_get_contents($path));

        $features = $this->loader->load($hash);
        $filename = $this->findRelativePath($path);

        return array_map(function (FeatureNode $feature) use ($filename) {
            return new FeatureNode(
                $feature->getTitle(),
                $feature->getDescription(),
                $feature->getTags(),
                $feature->getBackground(),
                $feature->getScenarios(),
                $feature->getKeyword(),
                $feature->getLanguage(),
                $filename,
                $feature->getLine()
            );
        }, $features);
    }
422244
private function loadFromCache($path)
    {
        if ($this->getCache()) {
            return $this->getCache()->read(self::CACHE_KEY . md5($path));
        }

        return false;
    }
40818
private function loadFile($path)
    {
        if (file_exists($path)) {
            return $this->loadJsonFile($path);
        }

        $dirs = $this->paths();
        if (empty($dirs)) {
            return null;
        }

        $data = [];
        $dirs = array_reverse($dirs);
        foreach ($dirs as $dir) {
            $file = $dir.DIRECTORY_SEPARATOR.$path;
            if (file_exists($file)) {
                $data = array_replace_recursive($data, $this->loadJsonFile($file));
            }
        }

        if (empty($data)) {
            return null;
        }

        return $data;
    }
907152
public function read($path)
    {
        try {
            $contents = file_get_contents($path);

        } catch (Exception $e) {

            throw (new ModelConfigurationFileException(
                "Could not find or open configuraion file at '{$path}'"
            ))->setPath($path);
        }

        // Determine whether to interpret the contents as PHP code or JSON data
        if ('<?php' == substr($contents, 0, 5)) {

            try {
                $contents = eval('?>' . $contents);

            } catch (Exception $e) {

                throw (new ModelConfigurationFileException(
                    "Could not interpret CMS model configuration PHP data for '{$path}'"
                ))->setPath($path);
            }

            if ( ! is_array($contents)) {
                throw (new ModelConfigurationFileException(
                    "CMS model configuration PHP file did not return an array for '{$path}'"
                ))->setPath($path);
            }

            return $contents;
        }

        // Fall back is to assume the file contains JSON content
        $json = json_decode($contents, true);

        if (null === $json) {
            throw (new ModelConfigurationFileException(
                "Could not interpret CMS model configuration as JSON data for '{$path}'"
            ))->setPath($path);
        }

        return $json;
    }
255490
public function load(string $path = '')
    {
        if ($path) {
            $testFileLoader = new TestFileLoader($this->options);
            $this->files = array_merge(
                $this->files,
                $testFileLoader->loadPath($path)
            );
        } elseif (
            isset($this->options->parallelSuite)
            && $this->options->parallelSuite
        ) {
            $this->suitesName = $this->configuration->getSuitesName();
        } elseif ($this->configuration->hasSuites()) {
            if (!empty($this->options->testsuite)) {
                $suites = [];
                foreach ($this->options->testsuite as $testsuite) {
                    $suites = array_merge($suites, $this->configuration->getSuiteByName($testsuite));
                }
            } else {
                $suites = $this->configuration->getSuites();
            }

            foreach ($suites as $suite) {
                foreach ($suite as $suitePath) {
                    $testFileLoader = new TestFileLoader($this->options);
                    $this->files = array_merge(
                        $this->files,
                        $testFileLoader->loadSuitePath($suitePath)
                    );
                }
            }
        }

        if (!$this->files && !\is_array($this->suitesName)) {
            throw new \RuntimeException('No path or configuration provided (tests must end with Test.php)');
        }

        $this->files = array_unique($this->files); // remove duplicates

        $this->initSuites();
    }
1364339
private function loadJsonFile($path)
    {
        $data = json_decode(file_get_contents($path), true);
        if (json_last_error() !== JSON_ERROR_NONE) {
            $error = json_last_error_msg() ?: 'Unknown error';
            throw new UnexpectedValueException(
                sprintf('JSON file "%s" could not be parsed: "%s"', $path, $error)
            );
        }

        if (!is_array($data)) {
            throw new UnexpectedValueException(
                sprintf('JSON file "%s" does not return an array', $path)
            );
        }

        return $data;
    }
92841
public function load($path)
    {
        $path = $this->findAbsolutePath($path);

        $iterator = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS)
        );
        $paths = array_map('strval', iterator_to_array($iterator));
        uasort($paths, 'strnatcasecmp');

        $features = array();

        foreach ($paths as $path) {
            $path = (string) $path;
            $loader = $this->gherkin->resolveLoader($path);

            if (null !== $loader) {
                $features = array_merge($features, $loader->load($path));
            }
        }

        return $features;
    }
1286967
public function load($path)
    {
        if (!file_exists($path)) {
            throw new PropelException(sprintf('File "%s" does not exist or is unreadable', $path));
        }
        ob_start();
        include($path);
        $contents = ob_get_clean();

        return $contents;
    }
1253676
public function load($path)
    {
        $key = $this->getCacheKey($path);

        if (isset($this->data[$key])) {
            return $this->data[$key];
        }

        return null;
    }
105224
private static function load($path)
    {
        // Load language file
        if (file_exists($path)) {
            require($path);
        }

        // Populate dictionary ($dictionary is declared inside $path)
        if (isset($dictionary) && is_array($dictionary)) {
            self::$_dictionary = array_merge(self::$_dictionary, $dictionary);
        }

        // Populate transliterations ($transliterations is declared inside $path)
        if (isset($transliterations) && is_array($transliterations)) {
            self::$_transliterations = array_merge(self::$_transliterations, $transliterations);
        }
    }
718383
public function loadModel($path)
    {
        $cfg = Config::newConfig($path);

        $this->loadSection($cfg, 'r');
        $this->loadSection($cfg, 'p');
        $this->loadSection($cfg, 'e');
        $this->loadSection($cfg, 'm');

        $this->loadSection($cfg, 'g');
    }