Caches a schema reference for future use.

@param stdClass $schema
@param Uri      $uri
355643
private function registerSchema(stdClass $schema, Uri $uri)
    {
        if (!isset($this->schemas[$uri->getPrimaryResourceIdentifier()])) {
            $this->schemas[$uri->getPrimaryResourceIdentifier()] = $schema;
        }
    }
1363186
public function setSchema($schema)
    {
        if (!\is_string($schema) && !$schema instanceof SchemaDefinitionInterface) {
            throw new InvalidSchemaDefinitionException();
        }

        $this->schema = $schema;
    }
273874
protected function removeDatabaseSchema(Connection $connection, DatabaseSchemaInterface $schema): void
    {
        $manager = $connection->getSchemaManager();

        if ($manager->tablesExist([$schema->getTokensScopesTable()]) === true) {
            $manager->dropTable($schema->getTokensScopesTable());
        }
        if ($manager->tablesExist([$schema->getClientsScopesTable()]) === true) {
            $manager->dropTable($schema->getClientsScopesTable());
        }
        if ($manager->tablesExist([$schema->getTokensTable()]) === true) {
            $manager->dropTable($schema->getTokensTable());
        }
        if ($manager->tablesExist([$schema->getRedirectUrisTable()]) === true) {
            $manager->dropTable($schema->getRedirectUrisTable());
        }
        if ($manager->tablesExist([$schema->getClientsTable()]) === true) {
            $manager->dropTable($schema->getClientsTable());
        }
        if ($manager->tablesExist([$schema->getScopesTable()]) === true) {
            $manager->dropTable($schema->getScopesTable());
        }
    }
913162
protected function _initializeSchema(TableSchema $schema)
    {
        $type = Configure::read('EmailQueue.serialization_type') ?: 'email_queue.serialize';
        $schema->setColumnType('template_vars', $type);
        $schema->setColumnType('headers', $type);
        $schema->setColumnType('attachments', $type);

        return $schema;
    }
1262377
public function upgradeSchema(Schema $schema)
    {
        $table = $schema->getTable('FileImageThumbnailPaths');
        if ($table->hasIndex('thumbnailPathID')) {
            $table->dropIndex('thumbnailPathID');
        }
        if (!$table->hasColumn('thumbnailFormat')) {
            $table->addColumn(
                'thumbnailFormat',
                'string',
                [
                    'notnull' => true,
                    'default' => '',
                    'length' => 5,
                ]
            );
            $table->setPrimaryKey([
                'fileID',
                'fileVersionID',
                'thumbnailTypeHandle',
                'storageLocationID',
                'thumbnailFormat',
            ]);
        }
    }
447245
protected function createDatabaseSchema(Connection $connection, DatabaseSchemaInterface $schema): void
    {
        try {
            $this->createDatabaseTables($connection, $schema);
            $this->createDatabaseViews($connection, $schema);
        } catch (DBALException $exception) {
            if ($connection->isConnected() === true) {
                $this->removeDatabaseSchema($connection, $schema);
            }

            throw $exception;
        }
    }
1366977
protected void setSchema(final String schema) throws DatabaseEngineException {
        try {
            this.conn.setSchema(schema);
        } catch (final Exception e) {
            throw new DatabaseEngineException(String.format("Could not set current schema to '%s'", schema), e);
        }
    }
453655
private function resolveRef($uri)
    {
        $uri = str_replace($this->baseUri, '', $uri);
        $schemaDir = realpath("{$this->rootDir}/vendor/claroline/distribution");

        return $schemaDir.'/'.$uri;
    }
380630
public void setSchemas(java.util.Collection<String> schemas) {
        if (schemas == null) {
            this.schemas = null;
            return;
        }

        this.schemas = new java.util.ArrayList<String>(schemas);
    }
178084
public function up(Schema $schema)
    {
        // copy images for example items
        $this->fs->mirror($this->source, $this->target);

        // create storage
        $storage = (new Storage())
            ->setDescription('Storage on local computer')
            ->setName('Local')
            ->setPath(Filesystem::getUserHomeDir())
            ->setType(Storage::TYPE_FOLDER);
        $this->em->persist($storage);

        // create items
        $this->persist($this->getItemOnePiece($storage));
        $this->persist($this->getItemFullmetalAlchemist($storage));
        $this->persist($this->getItemSpiritedAway($storage));
        $this->em->flush();
    }
259878
protected function result(Schema $schema)
    {
        $key = $this->generateVisitKey($schema);
        if (array_key_exists($key, $this->results)) {
            return $this->results[$key];
        }

        return null;
    }
1218842
protected void addIncludedSchemas(Schema schema) throws WSDLException, IOException, TransformerException, TransformerFactoryConfigurationError {
        List<SchemaReference> includes = schema.getIncludes();
        for (SchemaReference schemaReference : includes) {
            String schemaLocation;
            URI locationURI = URI.create(schemaReference.getSchemaLocationURI());
            if (locationURI.isAbsolute()) {
                schemaLocation = schemaReference.getSchemaLocationURI();
            } else {
                schemaLocation = schema.getDocumentBaseURI().substring(0, schema.getDocumentBaseURI().lastIndexOf('/') + 1) + schemaReference.getSchemaLocationURI();
            }

            schemaResources.add(new FileSystemResource(schemaLocation));
        }
    }
535033
public function upgradeSchema(Schema $schema)
    {
        try {
            $table = $schema->getTable('SystemDatabaseQueryLog');
            $table->addColumn('ID', 'integer', ['unsigned' => true, 'autoincrement' => true]);
            $table->setPrimaryKey(['ID']);
        } catch (\Exception $e) {
        }
    }
685187
public function map(string $schema, Table $table, string $name, FieldDefinition $definition)
    {
        foreach ($this->mapping as $mapping) {
            if ($mapping->maps($definition->type())) {
                $mapping->map($schema, $table, $name, $definition);
                return;
            }
        }

        throw DoctrineStorageException::unableToMapType($definition->type());
    }
179296
public function upgradeSchema(Schema $schema)
    {
        /* refresh CollectionVersionBlocks, CollectionVersionBlocksCacheSettings tables */
        $cvb = $schema->getTable('CollectionVersionBlocks');
        if (!$cvb->hasColumn('cbOverrideBlockTypeCacheSettings')) {
            $cvb->addColumn('cbOverrideBlockTypeCacheSettings', 'boolean', ['default' => 0]);
        }

        if (!$schema->hasTable('CollectionVersionBlocksCacheSettings')) {
            $cvbcs = $schema->createTable('CollectionVersionBlocksCacheSettings');
            $cvbcs->addColumn('cID', 'integer', ['notnull' => true, 'unsigned' => true, 'default' => 0]);
            $cvbcs->addColumn('cvID', 'integer', ['notnull' => true, 'unsigned' => true, 'default' => 1]);
            $cvbcs->addColumn('bID', 'integer', ['notnull' => true, 'unsigned' => true, 'default' => 0]);
            $cvbcs->addColumn('arHandle', 'string', ['notnull' => false]);
            $cvbcs->addColumn('btCacheBlockOutput', 'boolean', ['default' => 0]);
            $cvbcs->addColumn('btCacheBlockOutputOnPost', 'boolean', ['default' => 0]);
            $cvbcs->addColumn('btCacheBlockOutputForRegisteredUsers', 'boolean', ['default' => 0]);
            $cvbcs->addColumn('btCacheBlockOutputLifetime', 'integer', ['notnull' => true, 'unsigned' => true, 'default' => 0]);
            $cvbcs->setPrimaryKey(['cID', 'cvID', 'bId', 'arHandle']);
        }
    }
499280
function loadSchema(uri) {
  return new Promise(function(resolve, reject) {
    request.get(uri).end(function(error, response) {
      if (error || !response.ok) {
        error = error || new Error(response.body);
        debug("error fetching remote schema:", error);
        return reject(error);
      }
      return resolve(response.body);
    });
  });
}
655092
public function addParameter(ParameterSchema $schema)
    {
        $key = strtolower($schema->name);

        $this->parameters[$key] = $schema;
    }