Puli\Repository\AbstractJsonRepository::load PHP Method

load() protected method

Loads the JSON file.
protected load ( )
    protected function load()
    {
        $decoder = new JsonDecoder();
        $this->json = file_exists($this->path) ? (array) $decoder->decodeFile($this->path, $this->schemaPath) : array();
        if (isset($this->json['_order'])) {
            $this->json['_order'] = (array) $this->json['_order'];
            foreach ($this->json['_order'] as $path => $entries) {
                foreach ($entries as $key => $entry) {
                    $this->json['_order'][$path][$key] = (array) $entry;
                }
            }
        }
        // The root node always exists
        if (!isset($this->json['/'])) {
            $this->json['/'] = null;
        }
        // Make sure the JSON is sorted in reverse order
        krsort($this->json);
    }