Merge pull request #2679 from HB9HIL/migration_from_db_in_debug
Show latest Migration in Database in the Debug View
这个提交包含在:
		
						当前提交
						9f3d6d823f
					
				
					共有  3 个文件被更改,包括 29 次插入 和 0 次删除
				
			
		|  | @ -14,6 +14,10 @@ class Debug extends CI_Controller { | ||||||
|     { |     { | ||||||
|         $this->load->helper('file'); |         $this->load->helper('file'); | ||||||
| 
 | 
 | ||||||
|  |         $this->load->model('MigrationVersion'); | ||||||
|  | 
 | ||||||
|  |         $data['migration_version'] = $this->MigrationVersion->getMigrationVersion(); | ||||||
|  | 
 | ||||||
|         // Test writing to backup folder
 |         // Test writing to backup folder
 | ||||||
|         $backup_folder = $this->is_really_writable('backup'); |         $backup_folder = $this->is_really_writable('backup'); | ||||||
|         $data['backup_folder'] = $backup_folder; |         $data['backup_folder'] = $backup_folder; | ||||||
|  |  | ||||||
|  | @ -0,0 +1,20 @@ | ||||||
|  | <?php | ||||||
|  | 
 | ||||||
|  | class MigrationVersion extends CI_Model { | ||||||
|  | 
 | ||||||
|  | 	function getMigrationVersion() { | ||||||
|  |         $this->db->select_max('version'); | ||||||
|  |         $query = $this->db->get('migrations'); | ||||||
|  |         $migration_version = $query->row(); | ||||||
|  | 
 | ||||||
|  |         if ($query->num_rows() == 1) { | ||||||
|  |             $migration_version = $query->row()->version; | ||||||
|  |             return $migration_version; | ||||||
|  |         } else { | ||||||
|  |             return null; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | ?>
 | ||||||
|  | @ -21,6 +21,11 @@ | ||||||
|                         <td>Base URL</td> |                         <td>Base URL</td> | ||||||
|                         <td><span id="baseUrl"><a href="<?php echo $this->config->item('base_url')?>" target="_blank"><?php echo $this->config->item('base_url'); ?></a></span> <span data-toggle="tooltip" data-original-title="<?php echo lang('copy_to_clipboard'); ?>" onclick='copyURL("<?php echo $this->config->item('base_url'); ?>")'><i class="copy-icon fas fa-copy"></span></td>
 |                         <td><span id="baseUrl"><a href="<?php echo $this->config->item('base_url')?>" target="_blank"><?php echo $this->config->item('base_url'); ?></a></span> <span data-toggle="tooltip" data-original-title="<?php echo lang('copy_to_clipboard'); ?>" onclick='copyURL("<?php echo $this->config->item('base_url'); ?>")'><i class="copy-icon fas fa-copy"></span></td>
 | ||||||
|                     </tr> |                     </tr> | ||||||
|  |                     <tr> | ||||||
|  |                         <td>Migration</td> | ||||||
|  |                         <td><?php echo (isset($migration_version) ? $migration_version : "<span class='badge badge-danger'>There is something wrong with your Migration in Database!</span>"); ?></td>
 | ||||||
|  |                     </tr> | ||||||
|  | 
 | ||||||
|                 </table> |                 </table> | ||||||
|             </div> |             </div> | ||||||
|         </div> |         </div> | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用