break; case 'getRemotes': if (isset($_GET['path'])) { $result = $git->getRemotes(getWorkspacePath($_GET['path'])); if ($result === false) { echo '{"status":"error","message":"Failed to get remotes!"}'; } else { echo '{"status":"success","data":' . json_encode($result) . '}'; } } else { echo '{"status":"error","message":"Missing parameter!"}'; } break; case 'newRemote': if (isset($_GET['path']) && isset($_GET['name']) && isset($_GET['url'])) { $result = $git->newRemote(getWorkspacePath($_GET['path']), $_GET['name'], $_GET['url']); if ($result === false) { echo '{"status":"error","message":"Failed to create remotes!"}'; } else { echo '{"status":"success","message": "New Remote created."}'; } } else { echo '{"status":"error","message":"Missing parameter!"}'; } break; case 'removeRemote': if (isset($_GET['path']) && isset($_GET['name'])) { $result = $git->removeRemote(getWorkspacePath($_GET['path']), $_GET['name']); if ($result === false) { echo '{"status":"error","message":"Failed to remove remote!"}'; } else {