diff options
author | andi <andi@splitbrain.org> | 2005-01-24 21:03:09 +0100 |
---|---|---|
committer | andi <andi@splitbrain.org> | 2005-01-24 21:03:09 +0100 |
commit | f31d5b73c07fa4e2b21cfe3b28bdec1e76f7897f (patch) | |
tree | 36dc6c12bbf23fd67d3a9ebba71fa1356293126e | |
parent | 095bfd5c8eccb477e322519b4c86957ec2a9de02 (diff) | |
download | rpg-f31d5b73c07fa4e2b21cfe3b28bdec1e76f7897f.tar.gz rpg-f31d5b73c07fa4e2b21cfe3b28bdec1e76f7897f.tar.bz2 |
new versionstring method
darcs-hash:20050124200309-9977f-fda536f83c08a38d56f77a09bd99abdd1745e2fb.gz
-rw-r--r-- | doku.php | 2 | ||||
-rw-r--r-- | inc/common.php | 27 | ||||
-rw-r--r-- | inc/html.php | 2 |
3 files changed, 26 insertions, 5 deletions
@@ -6,8 +6,6 @@ * @author Andreas Gohr <andi@splitbrain.org> */ - define('DOKUWIKIVERSION','2005-01-17'); - ini_set('short_open_tag',"1"); require_once("conf/dokuwiki.php"); require_once("inc/common.php"); diff --git a/inc/common.php b/inc/common.php index dc50028b8..a76b247dd 100644 --- a/inc/common.php +++ b/inc/common.php @@ -889,8 +889,7 @@ function setCorrectLocale(){ * @author Aidan Lister <aidan@php.net> * @version 1.0.0 */ -function filesize_h($size, $dec = 1) -{ +function filesize_h($size, $dec = 1){ $sizes = array('B', 'KB', 'MB', 'GB'); $count = count($sizes); $i = 0; @@ -908,10 +907,34 @@ function filesize_h($size, $dec = 1) * * @author Andreas Gohr <andi@splitbrain.org> */ +function getVersion(){ + //import version string + if(@file_exists('VERSION')){ + //official release + return 'Release '.io_readfile('VERSION'); + }elseif(is_dir('_darcs')){ + //darcs checkout + $inv = file('_darcs/inventory'); + $inv = preg_grep('#andi@splitbrain\.org\*\*\d{14}#',$inv); + $cur = array_pop($inv); + preg_match('#\*\*(\d{4})(\d{2})(\d{2})#',$cur,$matches); + return 'Darcs '.$matches[1].'-'.$matches[2].'-'.$matches[3]; + }else{ + return 'snapshot?'; + } +} + +/** + * Run a few sanity checks + * + * @author Andreas Gohr <andi@splitbrain.org> + */ function check(){ global $conf; global $INFO; + msg('DokuWiki version: '.getVersion(),1); + if(version_compare(phpversion(),'4.3.0','<')){ msg('Your PHP version is too old ('.phpversion().' vs. 4.3.+ recommended)',-1); }elseif(version_compare(phpversion(),'4.3.10','<')){ diff --git a/inc/html.php b/inc/html.php index cd8651dde..e6221c14b 100644 --- a/inc/html.php +++ b/inc/html.php @@ -187,7 +187,7 @@ function html_head(){ <head> <title><?=$ID?> [<?=$conf['title']?>]</title> <meta http-equiv="Content-Type" content="text/html; charset=<?=$lang['encoding']?>" /> - <meta name="generator" content="DokuWiki <?=DOKUWIKIVERSION?>" /> + <meta name="generator" content="DokuWiki <?=getVersion()?>" /> <link rel="stylesheet" media="screen" type="text/css" href="<?=getBaseURL()?>style.css" /> <link rel="stylesheet" media="print" type="text/css" href="<?=getBaseURL()?>print.css" /> <link rel="shortcut icon" href="<?=getBaseURL()?>images/favicon.ico" /> |