+ if ( !isset( $data->manifest_version ) ) {
+ $this->output( "Warning: No manifest_version set, assuming 1.\n" );
+ // For backwards-compatability assume 1
+ $data->manifest_version = 1;
+ }
+ $version = $data->manifest_version;
+ if ( $version !== ExtensionRegistry::MANIFEST_VERSION ) {
+ $schemaPath = dirname( __DIR__ ) . "/docs/extension.schema.v$version.json";
+ } else {
+ $schemaPath = dirname( __DIR__ ) . '/docs/extension.schema.json';
+ }
+
+ if ( $version < ExtensionRegistry::OLDEST_MANIFEST_VERSION
+ || $version > ExtensionRegistry::MANIFEST_VERSION
+ ) {
+ $this->error( "Error: $path is using a non-supported schema version, it should use "
+ . ExtensionRegistry::MANIFEST_VERSION, 1 );
+ } elseif ( $version < ExtensionRegistry::MANIFEST_VERSION ) {
+ $this->output( "Warning: $path is using a deprecated schema, and should be updated to "
+ . ExtensionRegistry::MANIFEST_VERSION . "\n" );
+ }
+ $retriever = new JsonSchema\Uri\UriRetriever();
+ $schema = $retriever->retrieve( 'file://' . $schemaPath );