aboutsummaryrefslogtreecommitdiffstats
path: root/library/kzykhys/git/src/PHPGit/Command/CatCommand.php
diff options
context:
space:
mode:
Diffstat (limited to 'library/kzykhys/git/src/PHPGit/Command/CatCommand.php')
-rw-r--r--library/kzykhys/git/src/PHPGit/Command/CatCommand.php91
1 files changed, 0 insertions, 91 deletions
diff --git a/library/kzykhys/git/src/PHPGit/Command/CatCommand.php b/library/kzykhys/git/src/PHPGit/Command/CatCommand.php
deleted file mode 100644
index 0c4fc1f41..000000000
--- a/library/kzykhys/git/src/PHPGit/Command/CatCommand.php
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-
-namespace PHPGit\Command;
-
-use PHPGit\Command;
-use PHPGit\Exception\GitException;
-
-/**
- * Provide content or type and size information for repository objects - `git cat-file`
- *
- * @author Kazuyuki Hayashi <hayashi@valnur.net>
- */
-class CatCommand extends Command
-{
-
- /**
- * Returns the contents of blob object
- *
- * ``` php
- * $git = new PHPGit\Git();
- * $git->setRepository('/path/to/repo');
- * $contents = $git->cat->blob('e69de29bb2d1d6434b8b29ae775ad8');
- * ```
- *
- * @param string $object The name of the blob object to show
- *
- * @throws GitException
- * @return string
- */
- public function blob($object)
- {
- $process = $this->git->getProcessBuilder()
- ->add('cat-file')
- ->add('blob')
- ->add($object)
- ->getProcess();
-
- return $this->git->run($process);
- }
-
- /**
- * Returns the object type identified by **$object**
- *
- * ``` php
- * $git = new PHPGit\Git();
- * $git->setRepository('/path/to/repo');
- * $type = $git->cat->type('e69de29bb2d1d6434b8b29ae775ad8');
- * ```
- *
- * @param string $object The name of the object to show
- *
- * @throws GitException
- * @return string
- */
- public function type($object)
- {
- $process = $this->git->getProcessBuilder()
- ->add('cat-file')
- ->add('-t')
- ->add($object)
- ->getProcess();
-
- return trim($this->git->run($process));
- }
-
- /**
- * Returns the object size identified by **$object**
- *
- * ``` php
- * $git = new PHPGit\Git();
- * $git->setRepository('/path/to/repo');
- * $type = $git->cat->size('e69de29bb2d1d6434b8b29ae775ad8');
- * ```
- *
- * @param string $object The name of the object to show
- *
- * @throws GitException
- * @return string
- */
- public function size($object)
- {
- $process = $this->git->getProcessBuilder()
- ->add('cat-file')
- ->add('-s')
- ->add($object)
- ->getProcess();
-
- return trim($this->git->run($process));
- }
-
-} \ No newline at end of file