/** * Loads the given meta database * * @param string $databaseIdentifier * @return array<Document> */ protected function _loadMetaDataCollection($databaseIdentifier) { $path = ConfigurationManager::getSharedInstance()->getConfigurationForKeyPath('dataPath') . $databaseIdentifier . '.meta.json'; if (!file_exists($path)) { return array(); } $lock = Factory::createLock($databaseIdentifier); $lock->lock(); $fileData = file_get_contents($path); $lock->unlock(); // DebugUtility::printMemorySample(); $serializer = new JsonSerializer(); $dataCollection = $serializer->unserialize($fileData); // DebugUtility::printMemorySample(); return $dataCollection; }
/** * Return a lock for the given database * * @param string $databaseIdentifier * @return \Cundd\PersistentObjectStore\System\Lock\LockInterface */ protected function _getLockForDatabase($databaseIdentifier) { return Factory::createLock($databaseIdentifier); }