getServiceLocator()->get(common_persistence_Manager::SERVICE_ID); if ($persistenceManager->hasPersistence('default_kv')) { $report->add(Report::createInfo('"default_kv" persistence is already configured.')); } else { $newPersistenceConfig = [ 'driver' => common_persistence_SqlKvDriver::class, common_persistence_SqlKvDriver::OPTION_PERSISTENCE_SQL => 'default' ]; $persistenceManager->registerPersistence('default_kv', $newPersistenceConfig); $report->add(Report::createInfo('Setup new "default_kv" persistence.')); } $schemaCollection = $persistenceManager->getSqlSchemas(); $kvdriver = $persistenceManager->getPersistenceById('default_kv')->getDriver(); if ($kvdriver instanceof SchemaProviderInterface) { $kvdriver->provideSchema($schemaCollection); } $persistenceManager->applySchemas($schemaCollection); return $report; } }