- New 'Deploy from GitHub' button downloads latest code directly - No git configuration required - more reliable for git-unfriendly servers - Automatically syncs changed files (skips .git, vendor, writable) - Both methods available: git pull (if configured) or direct GitHub download - Each has a clear confirmation dialog explaining the method - Handles temporary extraction and cleanup automatically This solves HMS deployment when git is not accessible to PHP process
65 lines
1.4 KiB
PHP
65 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
use App\Controllers\BaseController;
|
|
use App\Libraries\SystemOperations;
|
|
|
|
class SystemOps extends BaseController
|
|
{
|
|
public function index(): string
|
|
{
|
|
$ops = new SystemOperations();
|
|
$data = [
|
|
'status' => $ops->collectStatus(),
|
|
'history' => $ops->getHistory(),
|
|
];
|
|
|
|
return view('Setting/Admin/system_ops', $data);
|
|
}
|
|
|
|
public function panel(): string
|
|
{
|
|
$ops = new SystemOperations();
|
|
$data = [
|
|
'status' => $ops->collectStatus(),
|
|
'history' => $ops->getHistory(),
|
|
];
|
|
|
|
return view('Setting/Admin/system_ops_panel', $data);
|
|
}
|
|
|
|
public function update()
|
|
{
|
|
$ops = new SystemOperations();
|
|
$result = $ops->runUpdate();
|
|
|
|
return $this->response->setJSON($result);
|
|
}
|
|
|
|
public function updateDirect()
|
|
{
|
|
$ops = new SystemOperations();
|
|
$result = $ops->runUpdateDirect();
|
|
|
|
return $this->response->setJSON($result);
|
|
}
|
|
|
|
public function action()
|
|
{
|
|
$action = (string) $this->request->getPost('action');
|
|
$ops = new SystemOperations();
|
|
$result = $ops->runServerAction($action);
|
|
|
|
return $this->response->setJSON($result);
|
|
}
|
|
|
|
public function diagnose()
|
|
{
|
|
$ops = new SystemOperations();
|
|
$diag = $ops->getGitDiagnosticsForWeb();
|
|
|
|
return $this->response->setJSON($diag);
|
|
}
|
|
}
|