Pocketmine Git client !
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Windows.php 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?php
  2. namespace Ad5001\Gitable;
  3. use pocketmine\Server;
  4. use pocketmine\Player;
  5. use Ad5001\Gitable\Main;
  6. class Windows extends GitClient {
  7. public function commit(string $message) : string {
  8. return shell_exec("git commit -m \"$message\"");
  9. }
  10. public function push(string $to = "github", string $from = "master") : string {
  11. return shell_exec("git push $to $from");
  12. }
  13. public function checkout($branch = null) : string {
  14. return shell_exec("git checkout " . (!is_null($branch) ? $this->getBranch() : $branch));
  15. }
  16. public function getBranch() : string {
  17. $handle = popen('git branch', 'r');
  18. $read = fread($handle, 2096);
  19. return explode(" ", $read)[1];
  20. }
  21. public function branch($branch = '') : string {
  22. return shell_exec("git branch " . $branch);
  23. }
  24. public function start() : string {
  25. return shell_exec("git init");
  26. }
  27. public function init() : string {
  28. return shell_exec("git init");
  29. }
  30. public function getDir() {
  31. return $this->dir;
  32. }
  33. public function cd($path) : string {
  34. if(is_dir($path)) {
  35. $dir = chdir($path);
  36. $this->dir = getcwd();
  37. return (string) $dir;
  38. } else {
  39. return "Directory $path not found !";
  40. }
  41. }
  42. public function clone($from) : string {
  43. }
  44. public function log() : string {
  45. }
  46. public function remove($path) : string {
  47. }
  48. public function move($path, $newpath) : string {
  49. }
  50. public function add($path) : string {
  51. }
  52. public function diff($path) : string {
  53. }
  54. public function status($path) : string {
  55. }
  56. public function remote($name, $url) : string {
  57. }
  58. public function pull($to = "github", $from = "master") : string {
  59. }
  60. }