We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

zingo on 06/24/08


Tagged

svn subversion cakephp


Versions (?)


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.