From c450f2aea937a53ab6e1b1b65b483d6b76c406d5 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Thu, 3 May 2012 19:38:26 +0000 Subject: [PATCH] #46 support for svn > 1.7 from Mike Stupalov git-svn-id: http://www.observium.org/svn/observer/trunk@3133 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/static-config.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/static-config.php b/includes/static-config.php index eb2b63a0d..6937abc96 100644 --- a/includes/static-config.php +++ b/includes/static-config.php @@ -1120,12 +1120,18 @@ if (file_exists($config['install_dir'] . '/.svn/entries')) } else { // SVN version >= 1.7 $xml = simplexml_load_string(shell_exec($config['svn'] . ' info --xml')); - $svn_rev = $xml->entry->commit->attributes()->revision; - $svn_date = $xml->entry->commit->date; + if ($xml != false) { + $svn_rev = $xml->entry->commit->attributes()->revision; + $svn_date = $xml->entry->commit->date; + } } list($svn_year, $svn_month, $svn_day) = explode("-", $svn_date); +} +if (!empty($svn_rev)) +{ $config['version'] = "0." . ($svn_year-2000) . "." . ($svn_month+0) . "." . $svn_rev; } else { + # FIXME - $config['release'] not needed $config['version'] = $config['version'] . "." . $config['release']; }