Skip to content

Commit 58ed3e2

Browse files
committed
Merge branch 'release/0.5.1'
2 parents 42c299d + 7f92097 commit 58ed3e2

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

ChangeLog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version 0.5.1
2+
-------------
3+
4+
* Fix building compatiblity with PHP 5.3.*
5+
thanks to grep-awesome@github
6+
17
Version 0.5
28
-----------
39

PHPCtags.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
class PHPCtags
33
{
4-
const VERSION = '0.5';
4+
const VERSION = '0.5.1';
55

66
private $mFile;
77

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ phpctags
44
An enhanced php [ctags](http://ctags.sourceforge.net/) index file generator
55
compatible with http://ctags.sourceforge.net/FORMAT.
66

7-
Using [PHP_Parse](https://github.com/nikic/PHP-Parser) as PHP syntax parsing
7+
Using [PHP_Parser](https://github.com/nikic/PHP-Parser) as PHP syntax parsing
88
backend, written in pure PHP. The generated ctags index file contains scope
99
and access information about class's methods and properties.
1010

buildPHAR.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22

33
$phar = new Phar('build/phpctags.phar', 0, 'phpctags.phar');
44

5+
if (version_compare(PHP_VERSION, '5.4.0') < 0) {
6+
class RecursiveCallbackFilterIterator extends RecursiveFilterIterator {
7+
public function __construct ( RecursiveIterator $iterator, $callback ) {
8+
$this->callback = $callback;
9+
parent::__construct($iterator);
10+
}
11+
12+
public function accept () {
13+
$callback = $this->callback;
14+
return $callback(parent::current(), parent::key(), parent::getInnerIterator());
15+
}
16+
17+
public function getChildren () {
18+
return new self($this->getInnerIterator()->getChildren(), $this->callback);
19+
}
20+
}
21+
}
22+
523
$phar->buildFromIterator(
624
new RecursiveIteratorIterator(
725
new RecursiveCallbackFilterIterator(
@@ -22,7 +40,7 @@ function ($current) {
2240

2341
foreach($excludes as $exclude) {
2442
if (fnmatch(getcwd().'/'.$exclude, $current->getPathName())) {
25-
return false;
43+
return false;
2644
}
2745
}
2846

0 commit comments

Comments
 (0)