Posted By

zingo on 06/24/08


Tagged

svn subversion cakephp


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

gerhardsletten


Using the svn revision number in cakePHP application


 / Published in: PHP
 

URL: http://bakery.cakephp.org/articles/view/using-your-application-svn-revision-number

  1. <?php
  2. if (!defined('REVISION')) {
  3. $svn = file(APP . '.svn' . DS . 'entries');
  4. if (is_numeric(trim($svn[3]))) {
  5. $version = $svn[3];
  6. } else { // pre 1.4 svn used xml for this file
  7. $version = explode('"', $svn[4]);
  8. $version = $version[1];
  9. }
  10. unset ($svn);
  11. define ('REVISION', $version);
  12. unset ($version);
  13. }
  14. ?>

Report this snippet  

You need to login to post a comment.