Created
November 1, 2011 18:05
-
-
Save kevinwritescode/1331388 to your computer and use it in GitHub Desktop.
Quickly get the SVN revision number at the application level of a ZEND project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Util_Svn | |
| { | |
| protected static $_revision; | |
| /** | |
| * Get the current SVN version at the application path folder | |
| * | |
| * @return string Revision Number | |
| */ | |
| public static function getRevision() | |
| { | |
| if (!self::$_revision) { | |
| $revision = exec('svnversion "' . APPLICATION_PATH . '"'); | |
| self::$_revision = preg_replace('/[^\d]/', '', $revision); | |
| } | |
| return self::$_revision; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment