summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorchris <chris@jalakai.co.uk>2006-08-29 15:48:06 +0200
committerchris <chris@jalakai.co.uk>2006-08-29 15:48:06 +0200
commit19a3223378923679493484987e6719c16b5f5997 (patch)
tree30cd513952b8abc1f0dd76eb269bdcb95077d1b3 /inc
parent02a498e7884db0beaec6950e3b36bf4384daba93 (diff)
downloadrpg-19a3223378923679493484987e6719c16b5f5997.tar.gz
rpg-19a3223378923679493484987e6719c16b5f5997.tar.bz2
further update to global memory cache arrays
- remove initialisation of caches in inc/pageutils.php - add global declaration to init.php to support init.php being included from within a function, e.g. unit testing ;-) - minor change to utf8_substr, remove non-essential brackets added as part of an earlier patch darcs-hash:20060829134806-9b6ab-ab15191344a83be664c412403dc84a24fa2253a2.gz
Diffstat (limited to 'inc')
-rw-r--r--inc/init.php4
-rw-r--r--inc/pageutils.php8
-rw-r--r--inc/utf8.php4
3 files changed, 4 insertions, 12 deletions
diff --git a/inc/init.php b/inc/init.php
index 13fb3a4bb..01d2f7469 100644
--- a/inc/init.php
+++ b/inc/init.php
@@ -24,8 +24,8 @@
else { error_reporting(DOKU_E_LEVEL); }
// init memory caches
- $cache_wikifn = array();
- $cache_cleanid = array();
+ global $cache_wikifn; $cache_wikifn = array();
+ global $cache_wikifn; $cache_cleanid = array();
//prepare config array()
global $conf;
diff --git a/inc/pageutils.php b/inc/pageutils.php
index 758d34a9e..5fadd7a36 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -58,10 +58,6 @@ function getID($param='id',$clean=true){
return $id;
}
-// function result cache for cleanID
-global $cache_cleanid;
-$cache_cleanid = array();
-
/**
* Remove unwanted chars from ID
*
@@ -145,10 +141,6 @@ function noNS($id) {
}
}
-// function result cache for wikiFN
-global $cache_wikifn;
-$cache_wikifn = array();
-
/**
* returns the full path to the datafile specified by ID and
* optional revision
diff --git a/inc/utf8.php b/inc/utf8.php
index 499952617..aa9594c42 100644
--- a/inc/utf8.php
+++ b/inc/utf8.php
@@ -137,9 +137,9 @@ function utf8_strlen($string){
function utf8_substr($str, $offset, $length = null) {
if(UTF8_MBSTRING){
if( $length === null ){
- return (mb_substr($str, $offset));
+ return mb_substr($str, $offset);
}else{
- return (mb_substr($str, $offset, $length));
+ return mb_substr($str, $offset, $length);
}
}