Skip to content

Commit

Permalink
Merge pull request #70 from artfulrobot/master
Browse files Browse the repository at this point in the history
Fix #69. Recursively follow symlinks.
  • Loading branch information
gianarb authored Mar 17, 2017
2 parents abdb8e2 + 9ddc0ef commit 19b59d6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 0.6.1

* Follow symlinks below directories. (Previously only symlinks in the top
directory were followed)

Version 0.6.0
* Exclude phpctags when re-building phar
* Fix typo in README.md
Expand Down
8 changes: 6 additions & 2 deletions PHPCtags.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
class PHPCtags
{
const VERSION = '0.6.0';
const VERSION = '0.6.1';

private $mFile;

Expand Down Expand Up @@ -525,7 +525,11 @@ public function __toString() {
class ReadableRecursiveDirectoryIterator extends RecursiveDirectoryIterator {
function getChildren() {
try {
return new ReadableRecursiveDirectoryIterator($this->getPathname());
return new ReadableRecursiveDirectoryIterator(
$this->getPathname(),
FilesystemIterator::SKIP_DOTS |
FilesystemIterator::FOLLOW_SYMLINKS);

} catch(UnexpectedValueException $e) {
file_put_contents('php://stderr', "\nPHPPCtags: {$e->getMessage()} - {$this->getPathname()}\n");
return new RecursiveArrayIterator(array());
Expand Down
2 changes: 1 addition & 1 deletion tests/Acceptance/AcceptanceTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected function assertTagsFileHeaderIsCorrect()
"!_TAG_PROGRAM_AUTHOR\ttechlivezheng\t/[email protected]/",
"!_TAG_PROGRAM_NAME\tphpctags\t//",
"!_TAG_PROGRAM_URL\thttps://github.com/techlivezheng/phpctags\t/official site/",
"!_TAG_PROGRAM_VERSION\t0.6.0\t//",
"!_TAG_PROGRAM_VERSION\t0.6.1\t//",
);

$realHeader = array_splice($this->tagsFileContent, 0, count($expectedHeader));
Expand Down

0 comments on commit 19b59d6

Please sign in to comment.