コード例 #1
0
 public function fire()
 {
     $this->comment('Updating documentation...');
     $this->git->setRepository(public_path() . '/Documentation');
     $this->git->pull('origin', 'master');
     $this->generator->generate();
     $this->call('cache:clear');
     $this->info('Documentation updated!');
 }
コード例 #2
0
ファイル: PullCommandTest.php プロジェクト: szoper/PHPGit
 public function testPull()
 {
     $git = new Git();
     $git->init($this->directory);
     $git->setRepository($this->directory);
     $git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
     $git->pull('origin', 'master');
     $this->assertFileExists($this->directory . '/README.md');
 }
コード例 #3
0
 /**
  * Return the path to the checked out repository for the supplied
  * manual and version.
  *
  * @param string $manual
  * @param string $version
  * @return string
  */
 private function getStoragePath($manual, $version)
 {
     $storagePath = storage_path('codex/' . $manual . '/' . $version);
     if (!file_exists($storagePath)) {
         $this->files->copyDirectory($this->storagePath . '/' . $manual, $storagePath, 0);
         $this->git->setRepository($storagePath);
         $this->git->checkout($version);
     } else {
         $this->cache->remember("{$manual}.{$version}.checkout", 10, function () use($version, $storagePath) {
             $this->git->setRepository($storagePath);
             $this->git->pull('origin', $version);
             return true;
         });
     }
     return $storagePath;
 }
コード例 #4
0
ファイル: GitTest.php プロジェクト: lshepstone/php-git
 public function testPullWithInvalidRepoDirectoryPathThrowsException()
 {
     $binary = '/usr/bin/git';
     $git = new Git($binary, new Process());
     $this->setExpectedException('\\PhpGit\\Exception\\RepoNotFoundException');
     $git->pull('mfs://repos/invalid-repo');
 }
コード例 #5
0
ファイル: Repository.php プロジェクト: lshepstone/php-git
 /**
  * Pulls from the default remote repository.
  */
 public function pull()
 {
     $this->git->pull($this->path);
 }