/** * @template Schema/Update.phtml * @return string */ public function updateAction() { $hash = hash('crc32', serialize($this->adapter->getSchema())); $hashCurrent = $hash; $this->view->set('current', $hash); do { $update = ROOT . sprintf($this->registry->get('database.schema'), $hash); if (file_exists($update)) { try { $this->adapter->getDriver()->query(file_get_contents($update)); } catch (\Exception $e) { $update = false; } } else { $update = false; } $hash = hash('crc32', serialize($this->adapter->getSchema())); } while (false !== $update && $hash !== $hashCurrent); return $this->view->set('new', $hash)->render(); }
public function testSchemaGeneratorDependency() { $this->assertTrue(is_array($this->adapter->getSchema())); }