X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FSourceDir%2FGit.php;h=9c51c7d25febbbb651eacb9d7e47251f01ab883b;hb=25b7d8e0878e236e592434c10b3eb76490126579;hp=e17a3055c15d1b5fd534e73f3bdbb3f529afbc67;hpb=e990b6dabecbdaf98b8d8b2173b0d697f9b2b754;p=pharext%2Fpharext diff --git a/src/pharext/SourceDir/Git.php b/src/pharext/SourceDir/Git.php index e17a305..9c51c7d 100644 --- a/src/pharext/SourceDir/Git.php +++ b/src/pharext/SourceDir/Git.php @@ -2,15 +2,22 @@ namespace pharext\SourceDir; -use pharext\Command; use pharext\Cli\Args; +use pharext\Exception; +use pharext\ExecCmd; +use pharext\License; +use pharext\PackageInfo; use pharext\SourceDir; +use pharext\Tempfile; /** * Extension source directory which is a git repo */ class Git implements \IteratorAggregate, SourceDir { + use License; + use PackageInfo; + /** * Base directory * @var string @@ -38,7 +45,18 @@ class Git implements \IteratorAggregate, SourceDir * @return array */ public function getPackageInfo() { - return []; + return $this->findPackageInfo($this->getBaseDir()); + } + + /** + * @inheritdoc + * @return string + */ + public function getLicense() { + if (($file = $this->findLicense($this->getBaseDir()))) { + return $this->readLicense($file); + } + return "UNKNOWN"; } /**