X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fpharext%2FSourceDir%2FBasic.php;fp=src%2Fpharext%2FSourceDir%2FBasic.php;h=5d44941edefc81cc8def3fe6441c2631cd346117;hb=10c6f10181e75139992ba92b7185fe9a50b889b2;hp=0000000000000000000000000000000000000000;hpb=337e76964be2ed6724633ac477affc3a28426c97;p=pharext%2Fpharext diff --git a/src/pharext/SourceDir/Basic.php b/src/pharext/SourceDir/Basic.php new file mode 100644 index 0000000..5d44941 --- /dev/null +++ b/src/pharext/SourceDir/Basic.php @@ -0,0 +1,51 @@ +path = $path; + } + + public function getBaseDir() { + return $this->path; + } + + public function getPackageInfo() { + return []; + } + + public function getArgs() { + return []; + } + + public function setArgs(Args $args) { + } + + public function getIterator() { + $rdi = new RecursiveDirectoryIterator($this->path, + FilesystemIterator::CURRENT_AS_SELF | // needed for 5.5 + FilesystemIterator::KEY_AS_PATHNAME | + FilesystemIterator::SKIP_DOTS); + $rii = new RecursiveIteratorIterator($rdi, + RecursiveIteratorIterator::CHILD_FIRST); + return $rii; + foreach ($rii as $path => $child) { + if (!$child->isDir()) { + #yield $path; + } + } + } +}