-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
59 lines (52 loc) · 1.42 KB
/
functions.php
File metadata and controls
59 lines (52 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
$functions['init']= function()
{
global $dict;
global $functions;
// new
if (isset($this->set))
{
$this->set->bindTo($this);
}
// end new
if (isset($this->_supertypes))
{
foreach ($this->_supertypes as $stk=>$stv)
{
if (!isset($this->_supertype))
{
$this->_supertype=array();
}
$this->_supertype[$stk]=clone $dict[$stk];
$this->_supertype[$stk]->_init=$functions['init']->bindTo($this->_supertype[$stk]);
$o=$this->_supertype[$stk]->_init;
$o();
}
}
};
function new_type($k)
{
global $dict;
if ( !isset($dict[$k]) )
{
$dict[$k]=new stdClass();
$dict[$k]->_type=$k;
}
else
{
return false;
}
return "CREATE TABLE IF NOT EXISTS ...";
} // END FUNCTION
function fix_reserved($s)
{
global $reserved;
foreach ($reserved as $rkl=>$rkv)
{
if ( in_array(strtolower($s),array_map('strtolower',$reserved[$rkl])) )
{
$s="_$s";
}
}
return $s;
}