diff --git a/src/JsonSchema/Uri/UriRetriever.php b/src/JsonSchema/Uri/UriRetriever.php index 51584d23..65452788 100644 --- a/src/JsonSchema/Uri/UriRetriever.php +++ b/src/JsonSchema/Uri/UriRetriever.php @@ -44,12 +44,6 @@ class UriRetriever implements BaseUriRetrieverInterface */ private $schemaCache = array(); - public function __construct() - { - // translate references to local files within the json-schema package - $this->setTranslation('|^package://|', sprintf('file://%s/', realpath(__DIR__ . '/../../..'))); - } - /** * Guarantee the correct media type was encountered * @@ -328,6 +322,9 @@ public function translate($uri) $uri = preg_replace($from, $to, $uri); } + // translate references to local files within the json-schema package + $uri = preg_replace('|^package://|', sprintf('file://%s/', realpath(__DIR__ . '/../../..')), $uri); + return $uri; } }