summaryrefslogtreecommitdiff
path: root/inc/infoutils.php
diff options
context:
space:
mode:
authorAndreas Gohr <gohr@cosmocode.de>2009-11-04 13:16:58 +0100
committerAndreas Gohr <gohr@cosmocode.de>2009-11-04 13:16:58 +0100
commite570ed43f12144c6db4693ddd798a433a6924485 (patch)
treedfb64943dce66087e0458f2990ff86451c30e57d /inc/infoutils.php
parentc66972f2cb89e65a8bbf8e39d42e8e479f7eb8dc (diff)
downloadrpg-e570ed43f12144c6db4693ddd798a433a6924485.tar.gz
rpg-e570ed43f12144c6db4693ddd798a433a6924485.tar.bz2
correctly read version from darcs2 inventory
Ignore-this: 93b8d0ec90f44d1fde05f94965d4e4e1 darcs-hash:20091104121658-6e07b-4336680ee1a7964872ce9c576f3dd9a18bb1c1e2.gz
Diffstat (limited to 'inc/infoutils.php')
-rw-r--r--inc/infoutils.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/inc/infoutils.php b/inc/infoutils.php
index 43df78a8c..0be050ce5 100644
--- a/inc/infoutils.php
+++ b/inc/infoutils.php
@@ -54,10 +54,18 @@ function getVersion(){
//official release
return 'Release '.trim(io_readfile(DOKU_INC.'VERSION'));
}elseif(is_dir(DOKU_INC.'_darcs')){
+ if(is_file(DOKU_INC.'_darcs/inventory')){
+ $inventory = DOKU_INC.'_darcs/inventory';
+ }elseif(is_file(DOKU_INC.'_darcs/hashed_inventory')){
+ $inventory = DOKU_INC.'_darcs/hashed_inventory';
+ }else{
+ return 'Darcs unknown';
+ }
+
//darcs checkout - read last 2000 bytes of inventory
- $sz = filesize(DOKU_INC.'_darcs/inventory');
+ $sz = filesize($inventory);
$seek = max(0,$sz-2000);
- $fh = fopen(DOKU_INC.'_darcs/inventory','rb');
+ $fh = fopen($inventory,'rb');
fseek($fh,$seek);
$chunk = fread($fh,2000);
fclose($fh);