use pharext\Cli\Args;
use pharext\License;
+use pharext\PackageInfo;
use pharext\SourceDir;
use FilesystemIterator;
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);
public function getArgs() {
return [];
}
-
+
public function setArgs(Args $args) {
}
$rii = new RecursiveIteratorIterator($rci);
foreach ($rii as $path => $child) {
if (!$child->isDir()) {
- yield $path;
+ yield realpath($path);
}
}
}