Ejemplo n.º 1
0
     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 {
             echo '{"status":"success","message":"Remote removed!"}';
         }
     } else {
         echo '{"status":"error","message":"Missing parameter!"}';
     }
     break;
 case 'renameRemote':
     if (isset($_GET['path']) && isset($_GET['name']) && isset($_GET['newName'])) {
         $result = $git->renameRemote(getWorkspacePath($_GET['path']), $_GET['name'], $_GET['newName']);
         if ($result === false) {
             echo '{"status":"error","message":"Failed to rename remote!"}';
         } else {