Skip to content

Commit da69a6a

Browse files
committed
Hold the version number in a class constant
1 parent db53c42 commit da69a6a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

PHPCtags.class.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22
class PHPCtags
33
{
4+
const VERSION = 0.3;
5+
46
private $mFile;
57

68
private $mFiles;

bootstrap.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
);
1212
}
1313

14-
$version = <<<'EOF'
15-
Version: 0.3
14+
$version = PHPCtags::VERSION;
1615

16+
$copyright = <<<'EOF'
1717
Exuberant Ctags compatiable PHP enhancement, Copyright (C) 2012 Techlive Zheng
1818
Addresses: <techlivezheng@gmail.com>, https://github.com/techlivezheng/phpctags
1919
EOF;
@@ -95,7 +95,7 @@
9595
}
9696

9797
if (isset($options['help'])) {
98-
echo $version;
98+
echo "Version: ".$version."\n\n".$copyright;
9999
echo PHP_EOL;
100100
echo PHP_EOL;
101101
echo $options_info;
@@ -104,7 +104,7 @@
104104
}
105105

106106
if (isset($options['version'])) {
107-
echo $version;
107+
echo "Version: ".$version."\n\n".$copyright;
108108
echo PHP_EOL;
109109
exit;
110110
}
@@ -224,7 +224,7 @@
224224
!_TAG_PROGRAM_AUTHOR\ttechlivezheng\t/techlivezheng@gmail.com/
225225
!_TAG_PROGRAM_NAME\tphpctags\t//
226226
!_TAG_PROGRAM_URL\thttps://github.com/techlivezheng/phpctags\t/official site/
227-
!_TAG_PROGRAM_VERSION\t0.3\t//\n
227+
!_TAG_PROGRAM_VERSION\t${version}\t//\n
228228
EOF;
229229

230230
fwrite($tagfile, $tagline.$result);

0 commit comments

Comments
 (0)