aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ogs/common/util.inc.php
diff options
context:
space:
mode:
authorgareth2007-03-14 03:38:10 +0000
committergareth2007-03-14 03:38:10 +0000
commit342caceac94aa652ebf8e6a81903cb0065ba1e1a (patch)
tree3c66d10fcb9a0a793722f569566c172928ab8e99 /ogs/common/util.inc.php
parentCleaned up PHP (diff)
downloadopensim-SC_OLD-342caceac94aa652ebf8e6a81903cb0065ba1e1a.zip
opensim-SC_OLD-342caceac94aa652ebf8e6a81903cb0065ba1e1a.tar.gz
opensim-SC_OLD-342caceac94aa652ebf8e6a81903cb0065ba1e1a.tar.bz2
opensim-SC_OLD-342caceac94aa652ebf8e6a81903cb0065ba1e1a.tar.xz
Missed a few
Diffstat (limited to 'ogs/common/util.inc.php')
-rw-r--r--ogs/common/util.inc.php42
1 files changed, 0 insertions, 42 deletions
diff --git a/ogs/common/util.inc.php b/ogs/common/util.inc.php
deleted file mode 100644
index b931205..0000000
--- a/ogs/common/util.inc.php
+++ /dev/null
@@ -1,42 +0,0 @@
1<?
2// Some generic utilities which may be used by any services
3
4function inc_lluuid($lluuid)
5{
6 $partB = substr($lluuid, 15);
7 $partB = (float)base_convert($partB,16,10)+1;
8 $partB = sprintf('%016x', $partB);
9 $partA = substr($lluuid, 0, 16);
10
11 if(substr($lluuid,15,16)=='FFFFFFFFFFFFFFFE') {
12 $partA = (float)base_convert($partA,16,10)+1;
13 $partA = sprintf('%016x', $partA);
14 }
15
16 $returnval = sprintf('%s%s',$partA, $partB);
17
18 return $returnval;
19}
20
21function format_lluuid($uuid)
22{
23 return strtolower(substr($uuid,0,8)."-".substr($uuid,8,4)."-".substr($uuid,12,4)."-".substr($uuid,16,4)."-".substr($uuid,20));
24}
25
26function output_xml_block($blockname, $data) {
27 echo("<$blockname>\n");
28 foreach($data as $name => $value) {
29 echo(" <$name>$value</$name>\n");
30 }
31 echo("</$blockname>\n");
32}
33
34function rand_uuid()
35{
36 return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
37 mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
38 mt_rand( 0, 0x0fff ) | 0x4000,
39 mt_rand( 0, 0x3fff ) | 0x8000,
40 mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) );
41}
42?>