devsofttech_hms_ci4/app/Controllers/SystemOps.php
DevSoftTech Server cb4636e599 feat: add detailed git diagnostics endpoint
- New /setting/admin/system-ops/diagnose endpoint
- Shows git binary location, version, config values
- Includes file permissions and directory checks
- Displays actual git command outputs with exit codes
- Provides troubleshooting commands for setup

This helps debug git configuration issues without guessing
2026-08-04 03:13:59 +05:30

57 lines
1.3 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 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);
}
}