{'$id'}) && $schema !== null) { $this->urnSchemas[$schema->{'$id'}] = $schema; } } } } /** * @param string $url The file url * @return \stdClass|false json_decode of $url resource content */ public function getSchemaData($url) { if (isset($this->urnSchemas[$url])) {// Handle urn: urls return $this->urnSchemas[$url]; } elseif (is_file($url)) {// Handle file return json_decode((string) file_get_contents($url)); } else {// Handle URL return json_decode((string) file_get_contents(rawurldecode($url))); } } }