コード例 #1
0
ファイル: Loader.php プロジェクト: vierbergenlars/gihp
 /**
  * Loads the object
  * @param  string   $sha1 The hash of the object to load
  * @return Internal
  */
 public function load($sha1)
 {
     return $this->io->readObject($sha1);
 }
コード例 #2
0
ファイル: AnnotatedTag.php プロジェクト: vierbergenlars/gihp
 /**
  * Writes the annotated tag to IO
  * @param IOInterface $io The IO to write to
  * @internal
  */
 public function write(IOInterface $io)
 {
     $io->addObject($this);
     $this->object->write($io);
 }
コード例 #3
0
ファイル: Repository.php プロジェクト: vierbergenlars/gihp
 /**
  * Removes a branch
  * @param Branch $branch The branch to remove
  */
 public function removeBranch(Branch $branch)
 {
     $this->io->removeRef($branch->getHead());
 }
コード例 #4
0
ファイル: Tree.php プロジェクト: vierbergenlars/gihp
 /**
  * Writes the tree and all its linked objects to IO
  * @internal
  */
 public function write(IOInterface $io)
 {
     $io->addObject($this);
     foreach ($this->objects as $object) {
         $object[0]->write($io);
     }
 }
コード例 #5
0
ファイル: Reference.php プロジェクト: vierbergenlars/gihp
 /**
  * Writes the reference and the object it refers to to disk
  * @param \gihp\IO\IOInterface $io
  */
 public function write(IOInterface $io)
 {
     $io->addRef($this);
     $this->commit->write($io);
 }
コード例 #6
0
ファイル: Branch.php プロジェクト: vierbergenlars/gihp
 /**
  * Writes the branch to IO
  * @param IOInterface $io An IOInterface to write to
  */
 public function write(IOInterface $io)
 {
     if (!$this->ref) {
         throw new \LogicException('Branch cannot be written if no head reference exists');
     }
     try {
         $io->removeRef($this->ref);
     } catch (\RuntimeException $e) {
         //Nothing to worry about, the ref just does not exist.
     }
     $this->ref->write($io);
 }
コード例 #7
0
ファイル: Commit.php プロジェクト: vierbergenlars/gihp
 /**
  * Writes the commit and its dependencies to IO
  * @internal
  */
 public function write(IOInterface $io)
 {
     $io->addObject($this);
     foreach ($this->parents as $parent) {
         $parent->write($io);
     }
     $this->tree->write($io);
 }
コード例 #8
0
ファイル: Loader.php プロジェクト: vierbergenlars/gihp
 /**
  * Loads the reference
  * @param  string    $path The path to the reference
  * @return Reference
  */
 public function load($path)
 {
     return $this->io->readRef($path);
 }
コード例 #9
0
 /**
  * Writes the symbolic reference and the object it points to to disk
  * @param \gihp\IO\IOInterface $io
  */
 public function write(\gihp\IO\IOInterface $io)
 {
     $io->moveHead($this);
     $this->head->write($io);
 }