diff --git a/nexus/Install/Install.php b/nexus/Install/Install.php index afc891dc..b3f4652b 100644 --- a/nexus/Install/Install.php +++ b/nexus/Install/Install.php @@ -632,4 +632,16 @@ class Install return compact('version', 'match'); } + public function checkLock($path) + { + if (file_exists("$path/.lock")) { + die("Locked! Delete .lock file first"); + } + } + + public function setLock($path) + { + file_put_contents("$path/.lock", "Lock at: " . date('Y-m-d H:i:s')); + } + } diff --git a/nexus/Install/install/install.php b/nexus/Install/install/install.php index e2a86e39..253e09da 100644 --- a/nexus/Install/install/install.php +++ b/nexus/Install/install/install.php @@ -5,6 +5,7 @@ require ROOT_PATH . 'nexus/Install/install_update_start.php'; $isPost = $_SERVER['REQUEST_METHOD'] == 'POST'; $install = new \Nexus\Install\Install(); +$install->checkLock(__DIR__); $currentStep = $install->currentStep(); $maxStep = $install->maxStep(); if (!$install->canAccessStep($currentStep)) { @@ -191,6 +192,7 @@ if (!empty($error) || (isset($mysqlInfo) && !$mysqlInfo['match'])) { echo '
' . $install->getLogFile() . '' . $install->getInsallDirectory() . '' . $update->getLogFile() . '' . $update->getUpdateDirectory() . '