public function run() { echo '---------------------------------------------' . PHP_EOL; echo 'Dumping database ' . $this->database->getDatabaseName() . PHP_EOL; echo '---------------------------------------------' . PHP_EOL; Git::cloneRepository($this->cwd, $this->gitRepository); $this->dumpDatabase(); Git::commit($this->cwd, $this->gitRepository); Git::push($this->cwd, $this->gitRepository); }
function testMultipleCommitsInSinglePush() { $Cleanup = new Folder(TMP . 'tests/git'); if ($Cleanup->pwd() == TMP . 'tests/git') { $Cleanup->delete(); } $Git = new Git($this->__repos[1]); $this->assertTrue($Git->create()); $this->assertTrue(file_exists(TMP . 'tests/git/repo/test.git')); $this->assertTrue(file_exists(TMP . 'tests/git/working/test/master/.git')); $File = new File(TMP . 'tests/git/working/test/new.text', true); $File->write('this is something new'); $Git->commit(array("-m", "'Pushing to fork'")); $File = new File(TMP . 'tests/git/working/test/new.text', true); $File->write('this is something new again'); $Git->commit(array("-m", "'Pushing to fork again'")); $Git->push('origin', 'master'); $data = $Git->read(); $this->assertTrue($data['message'], 'Pushing to fork again'); $this->assertTrue(file_exists(TMP . 'tests/git/working/test/new.text')); $File = new File(TMP . 'tests/git/working/test/new.text', true); $File->write('this is something new again'); $Git->commit(array("-m", "'Pushing to fork again again'")); $Git->push('origin', 'master'); $data = $Git->read(); $this->assertTrue($data['message'], 'Pushing to fork again again'); //pr($Git->run('log', array('--pretty=oneline'))); //$info = $Git->run('log', array("--pretty=format:%P%x00%H%x00%an%x00%ai%x00%s"), 'capture'); //list($parent, $revision, $author, $commit_date, $message) = explode(chr(0), $info[0]); //pr($Git->run('rev-list', array($parent, $revision))); //pr($Git->run('log', array($revision, "--pretty=format:%P%x00%H%x00%an%x00%ai%x00%s"), 'capture')); //pr($Git->debug); }
break; case 'merge': if (isset($_GET['path']) && isset($_GET['name'])) { $result = $git->merge(getWorkspacePath($_GET['path']), $_GET['name']); if ($result === false) { echo '{"status":"error","message":"Failed to merge branch!"}'; } else { echo '{"status":"success","message":"Branch merged!"}'; } } else { echo '{"status":"error","message":"Missing parameter!"}'; } break; case 'push': if (isset($_GET['path']) && isset($_GET['remote']) && isset($_GET['branch'])) { echo $git->push(getWorkspacePath($_GET['path']), $_GET['remote'], $_GET['branch']); } else { echo '{"status":"error","message":"Missing parameter!"}'; } break; case 'pull': if (isset($_GET['path']) && isset($_GET['remote']) && isset($_GET['branch'])) { echo $git->pull(getWorkspacePath($_GET['path']), $_GET['remote'], $_GET['branch']); } else { echo '{"status":"error","message":"Missing parameter!"}'; } break; case 'rename': if (isset($_GET['path']) && isset($_GET['old_name']) && isset($_GET['new_name'])) { echo $git->renameItem(getWorkspacePath($_GET['path']), $_GET['old_name'], $_GET['new_name']); } else {
public function push() { parent::push(); echo "your phonenumber is :{$this->phone}<br>"; echo "this is my email :{$this->email}<br>"; }