private function fetchStatusBefore()
{
$this->stateBefore = new \ArrayObject();
$this->fetchMysqlStatusBefore('adodb');
if (\Scalr::getContainer()->analytics->enabled) {
try {
$this->fetchMysqlStatusBefore('cadb');
} catch (\Exception $e) {
if (preg_match('~connect|upgrades. doesn.t exist~i', $e->getMessage())) {
//Database may not exist because of creating from some update
} else {
throw $e;
}
}
}
//Loads updates of FileSystem type
self::checkFilesystemStorage();
//Loads performed updates of Filesystem type
foreach (new FilesystemStorageIterator(self::FS_STORAGE_PATH) as $fileInfo) {
/* @var $fileInfo \SplFileInfo */
if (!$fileInfo->isReadable()) {
throw new Exception\UpgradeException(sprintf('Could not read from file "%s". Lack of access permissions.', $fileInfo->getFilename()));
}
$entity = new FilesystemUpgradeEntity();
$obj = unserialize(file_get_contents($fileInfo->getPathname()));
if (!is_object($obj)) {
throw new Exception\UpgradeException(sprintf('There was error while trying to load record from filesystem storage "%s". Object is expected, %s given', $fileInfo->getPathname(), gettype($obj)));
}
$entity->load($obj);
$this->stateBefore[$entity->uuid] = $entity;
if (isset($entity->appears) && $this->maxDate < $entity->appears) {
$this->maxDate = $entity->appears;
}
unset($obj);
}
}