当前位置: 首页>>代码示例>>PHP>>正文


PHP Git::read方法代码示例

本文整理汇总了PHP中Git::read方法的典型用法代码示例。如果您正苦于以下问题:PHP Git::read方法的具体用法?PHP Git::read怎么用?PHP Git::read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Git的用法示例。


在下文中一共展示了Git::read方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testMultipleCommitsInSinglePush

 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);
 }
开发者ID:Theaxiom,项目名称:chaw-source,代码行数:33,代码来源:git.test.php


注:本文中的Git::read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。