Using the svn revision number in cakePHP application


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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. ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.