Skip to content

Instantly share code, notes, and snippets.

@kevinwritescode
Created November 1, 2011 18:05
Show Gist options
  • Select an option

  • Save kevinwritescode/1331388 to your computer and use it in GitHub Desktop.

Select an option

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
<?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