echo '{"status":"error","message":"' . $git->result . '!"}'; } } else { echo '{"status":"error","message":"Missing parameter!"}'; } break; case 'clone': if (isset($_GET['path']) && isset($_GET['repo'])) { echo $git->cloneRepo(getWorkspacePath($_GET['path']), $_GET['repo']); } else { echo '{"status":"error","message":"Missing parameter!"}'; } break; case 'status': if (isset($_GET['path'])) { $result = $git->status(getWorkspacePath($_GET['path'])); if ($result === false) { echo '{"status":"error","message":"Failed to get status!"}'; } else { echo '{"status":"success","data":' . json_encode($result) . '}'; } } else { echo '{"status":"error","message":"Missing parameter!"}'; } break; case 'add': if (isset($_GET['path']) && isset($_POST['files'])) { $files = json_decode($_POST['files']); if ($files) { $result = true; foreach ($files as $file) {