X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FSourceDir%2FBasic.php;h=e5b2d230c36ea071dc4e28133a09895df2abd7f1;hb=d5207a43143f6c41520d024ba682cd5d69517416;hp=fa180fee5896eede4bcefb5aebf2032a9c45e07b;hpb=e44f0adc7b18845a2cd3dc63fdab5d9bcdc10f76;p=pharext%2Fpharext diff --git a/src/pharext/SourceDir/Basic.php b/src/pharext/SourceDir/Basic.php index fa180fe..e5b2d23 100644 --- a/src/pharext/SourceDir/Basic.php +++ b/src/pharext/SourceDir/Basic.php @@ -4,6 +4,7 @@ namespace pharext\SourceDir; use pharext\Cli\Args; use pharext\License; +use pharext\PackageInfo; use pharext\SourceDir; use FilesystemIterator; @@ -16,21 +17,26 @@ use RecursiveIteratorIterator; class Basic implements IteratorAggregate, SourceDir { use License; - + use PackageInfo; + private $path; - + public function __construct($path) { - $this->path = $path; + $this->path = realpath($path); } - + public function getBaseDir() { return $this->path; } - + + /** + * @inheritdoc + * @return array + */ public function getPackageInfo() { - return []; + return $this->findPackageInfo($this->getBaseDir()); } - + public function getLicense() { if (($file = $this->findLicense($this->getBaseDir()))) { return $this->readLicense($file); @@ -41,7 +47,7 @@ class Basic implements IteratorAggregate, SourceDir public function getArgs() { return []; } - + public function setArgs(Args $args) { } @@ -62,7 +68,7 @@ class Basic implements IteratorAggregate, SourceDir $rii = new RecursiveIteratorIterator($rci); foreach ($rii as $path => $child) { if (!$child->isDir()) { - yield $path; + yield realpath($path); } } }