* @package generis * */ class common_ext_GenerisInstaller extends common_ext_ExtensionInstaller { /** * Setup the ontology configuration * * @throws common_Exception * @throws common_ext_ExtensionException * @throws common_ext_InstallationException * @throws ManifestNotFoundException */ public function install() { if ($this->extension->getId() != 'generis') { throw new common_ext_ExtensionException('Tried to install "' . $this->extension->getId() . '" extension using the GenerisInstaller'); } $this->installLoadDefaultConfig(); $this->setupSchema(); $this->installOntology(); $this->installRegisterExt(); $this->getServiceManager()->get(SimpleCache::SERVICE_ID)->clear(); $this->log('d', 'Installing custom script for extension ' . $this->extension->getId()); $this->installCustomScript(); } public function setupSchema() { $schemaCollection = $this->getPersistenceManager()->getSqlSchemas(); $ontology = $this->getServiceManager()->get(Ontology::SERVICE_ID); if ($ontology instanceof SchemaProviderInterface) { $ontology->provideSchema($schemaCollection); } $this->getPersistenceManager()->applySchemas($schemaCollection); } /** * @return PersistenceManager */ protected function getPersistenceManager() { return $this->getServiceManager()->get(PersistenceManager::SERVICE_ID); } }