/** * Perform cleanup for a process that has run. * @access private */ protected function _post_execute() { if (!$this->env->num_exceptions_raised) { $this->info->database_version = $this->version_to; if (!$this->testing) { $this->info->store(); } $this->_log('Migration completed with (0) errors.', Msg_type_info); } else { $this->_log('Version not updated because of [' . $this->env->num_exceptions_raised . '] errors.', Msg_type_warning); } }
/** * Initialize all versions for this app and environment. * @param APPLICATION $app */ public function load_from($obj) { if ($this->db->table_exists($this->app->table_names->versions)) { $class_name = $this->app->final_class_name('FRAMEWORK_INFO_QUERY', 'webcore/db/framework_info_query.php'); $query = new $class_name($this->app); $this->app_info = $query->info_for($obj); $query->clear_restrictions(); $this->lib_info = $query->info_for($this->env); } if (!isset($this->app_info)) { $this->app_info = $this->_make_object(); switch ($obj->framework_id) { case 'com.earthli.albums': $this->app_info->database_version = '2.8.0'; break; case 'com.earthli.news': $this->app_info->database_version = '2.7.0'; break; case 'com.earthli.projects': $this->app_info->database_version = '1.8.0'; break; case 'com.earthli.recipes': $this->app_info->database_version = '1.6.0'; break; } } if (!isset($this->lib_info)) { $this->lib_info = $this->_make_object($this->env->title); $this->lib_info->database_version = '2.6.0'; } $this->app_info->set_software($obj); $this->lib_info->set_software($this->env); }