File tree Expand file tree Collapse file tree 5 files changed +95
-9
lines changed Expand file tree Collapse file tree 5 files changed +95
-9
lines changed Original file line number Diff line number Diff line change 1- vendor
2- composer.phar
31tests /* .expect
42tests /* .result
3+ build /
4+ vendor /
5+ phpctags
Original file line number Diff line number Diff line change 1+ source := README.md \
2+ ChangeLog.md \
3+ composer.json \
4+ composer.lock \
5+ bootstrap.php \
6+ PHPCtags.class.php
7+
8+ .PHONY : all
9+ all : phpctags
10+
11+ .PHONY : clean
12+ clean :
13+ @echo " Cleaning executables ..."
14+ @rm -f ./phpctags
15+ @rm -f ./build/phpctags.phar
16+ @echo " Done!"
17+
18+ .PHONY : dist-clean
19+ dist-clean :
20+ @echo " Cleaning old build files and vendor libraries ..."
21+ @rm -rf ./build
22+ @rm -rf ./vendor
23+ @echo " Done!"
24+
25+ .PHONY : install
26+ install : phpctags
27+ @echo " Sorry, you need to move phpctags to /usr/bin/phpctags or /usr/local/bin/phpctags or any place you want manually."
28+
29+ build :
30+ @if [ ! -x build ]; \
31+ then \
32+ mkdir build; \
33+ fi
34+
35+ build/composer.phar : | build
36+ @echo " Installing composer ..."
37+ @curl -s http://getcomposer.org/installer | php -- --install-dir=build
38+
39+ vendor : composer.lock build/composer.phar
40+ @echo " Installing vendor libraries ..."
41+ @php build/composer.phar install
42+ @touch vendor/
43+
44+ build/phpctags.phar : vendor $(source ) | build
45+ @php -dphar.readonly=0 buildPHAR.php
46+ @chmod +x build/phpctags.phar
47+
48+ phpctags : build/phpctags.phar
49+ @echo " Building phpctags ..."
50+ @cp build/phpctags.phar phpctags
51+ @echo " Done!"
Original file line number Diff line number Diff line change @@ -18,12 +18,9 @@ Enjoy!
1818Installation
1919------------
2020
21- We use [ composer] ( http://getcomposer.org/ ) for dependency management, run the
22- following commands under the project directory to get composer and install the
23- dependency.
24-
25- curl -s http://getcomposer.org/installer | php
26- php composer.phar install
21+ Installation is simple, just run ` make ` in the root directory of the source,
22+ you will get a ` phpctags ` PHAR executable, add it to your ` $PATH ` , then you
23+ can invoke ` phpcatgs ` directly from anywhere.
2724
2825See [ phpctags on packagist] ( http://packagist.org/packages/techlivezheng/phpctags )
2926for more details.
Original file line number Diff line number Diff line change 1- #!/usr/bin/env php
21<?php
32if (file_exists ($ autoload = __DIR__ . '/vendor/autoload.php ' )) {
43 require ($ autoload );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ $ phar = new Phar ('build/phpctags.phar ' , 0 , 'phpctags.phar ' );
4+
5+ $ phar ->buildFromIterator (
6+ new RecursiveIteratorIterator (
7+ new RecursiveCallbackFilterIterator (
8+ new RecursiveDirectoryIterator (
9+ getcwd (),
10+ FilesystemIterator::SKIP_DOTS
11+ ),
12+ function ($ current ) {
13+ $ excludes = array (
14+ '.* ' ,
15+ 'tags ' ,
16+ 'build/* ' ,
17+ 'tests/* ' ,
18+ 'Makefile ' ,
19+ 'phpctags.sh ' ,
20+ 'buildPHAR.php ' ,
21+ );
22+
23+ foreach ($ excludes as $ exclude ) {
24+ if (fnmatch (getcwd ().'/ ' .$ exclude , $ current ->getPathName ())) {
25+ return false ;
26+ }
27+ }
28+
29+ return true ;
30+ }
31+ )
32+ ),
33+ getcwd ()
34+ );
35+
36+ $ phar ->setStub (
37+ "#!/usr/bin/env php \n" .$ phar ->createDefaultStub ('bootstrap.php ' )
38+ );
You can’t perform that action at this time.
0 commit comments