first commit
Some checks failed
Build / run (push) Has been cancelled

This commit is contained in:
maher
2025-10-29 11:42:25 +01:00
commit 703f50a09d
4595 changed files with 385164 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<?php namespace Common\Core\Install;
use Common\Core\BaseController;
use Common\Settings\DotEnvEditor;
use Exception;
class UpdateController extends BaseController
{
public function __construct()
{
if (
!config('common.site.disable_update_auth') &&
version_compare(
config('common.site.version'),
$this->getAppVersion(),
) === 0
) {
$this->middleware('isAdmin');
}
}
public function show()
{
$data = (new CheckSiteHealth())->execute();
return view('common::install/update')->with($data);
}
public function performUpdate()
{
(new UpdateActions())->execute();
return view('common::install/update-complete');
}
private function getAppVersion(): string
{
try {
return (new DotEnvEditor('env.example'))->load()['app_version'];
} catch (Exception $e) {
return config('common.site.version');
}
}
}