X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FSourceDir%2FGit.php;h=e17a3055c15d1b5fd534e73f3bdbb3f529afbc67;hb=e990b6dabecbdaf98b8d8b2173b0d697f9b2b754;hp=8e35bf9b3f50fb292501f6c02652f090397685e8;hpb=4acccbbedeb300e70cc06d9253e95bafeb7a2859;p=pharext%2Fpharext diff --git a/src/pharext/SourceDir/Git.php b/src/pharext/SourceDir/Git.php index 8e35bf9..e17a305 100644 --- a/src/pharext/SourceDir/Git.php +++ b/src/pharext/SourceDir/Git.php @@ -3,6 +3,7 @@ namespace pharext\SourceDir; use pharext\Command; +use pharext\Cli\Args; use pharext\SourceDir; /** @@ -10,12 +11,6 @@ use pharext\SourceDir; */ class Git implements \IteratorAggregate, SourceDir { - /** - * The Packager command - * @var pharext\Command - */ - private $cmd; - /** * Base directory * @var string @@ -26,8 +21,7 @@ class Git implements \IteratorAggregate, SourceDir * @inheritdoc * @see \pharext\SourceDir::__construct() */ - public function __construct(Command $cmd, $path) { - $this->cmd = $cmd; + public function __construct($path) { $this->path = $path; } @@ -38,7 +32,29 @@ class Git implements \IteratorAggregate, SourceDir public function getBaseDir() { return $this->path; } - + + /** + * @inheritdoc + * @return array + */ + public function getPackageInfo() { + return []; + } + + /** + * @inheritdoc + * @return array + */ + public function getArgs() { + return []; + } + + /** + * @inheritdoc + */ + public function setArgs(Args $args) { + } + /** * Generate a list of files by `git ls-files` * @return Generator @@ -50,13 +66,7 @@ class Git implements \IteratorAggregate, SourceDir $path = realpath($this->path); while (!feof($pipe)) { if (strlen($file = trim(fgets($pipe)))) { - if ($this->cmd->getArgs()->verbose) { - $this->cmd->info("Packaging %s\n", $file); - } /* there may be symlinks, so no realpath here */ - if (!file_exists("$path/$file")) { - $this->cmd->warn("File %s does not exist in %s\n", $file, $path); - } yield "$path/$file"; } } @@ -64,7 +74,7 @@ class Git implements \IteratorAggregate, SourceDir } chdir($pwd); } - + /** * Implements IteratorAggregate * @see IteratorAggregate::getIterator()