/** * Set default model properties */ public function before() { $this->scriptVersion = Version::VERSION; $this->dbVersion = System::getVar('version')['data']; $this->versionsEqual = version_compare($this->scriptVersion, $this->dbVersion) === 0; $this->findLatestVersion(); $this->haveRemoteNew = $this->lastVersion !== null && version_compare($this->scriptVersion, $this->lastVersion) === -1; }
/** * Include files with update queries */ public function make() { // run update queries from included files foreach ($this->updateQueries as $file) { @(include root . '/Private/Database/Updates/' . $file . '.php'); } // update version in db table $row = System::getVar('version'); $row->data = $this->scriptVersion; $row->save(); }