예제 #1
0
파일: Blob.php 프로젝트: phecho/Gitlib
 public function getContent()
 {
     if (null === $this->content) {
         $this->content = $this->repository->run('show ' . $this->hash);
     }
     return $this->content;
 }
예제 #2
0
파일: Client.php 프로젝트: phecho/Gitlib
 /**
  * Creates a new repository on the specified path.
  *
  * @param string $path Path where the new repository will be created
  *
  * @return Repository Instance of Repository
  */
 public function createRepository($path, $bare = null)
 {
     if (file_exists($path . '/.git/HEAD') && !file_exists($path . '/HEAD')) {
         throw new \RuntimeException('A GIT repository already exists at ' . $path);
     }
     $repository = new Repository($path, $this);
     return $repository->create($bare);
 }