forked from Open-Web-Analytics/Open-Web-Analytics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
owa_base.php
162 lines (131 loc) · 2.98 KB
/
owa_base.php
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
//
// Open Web Analytics - An Open Source Web Analytics Framework
//
// Copyright 2006 Peter Adams. All rights reserved.
//
// Licensed under GPL v2.0 http://www.gnu.org/copyleft/gpl.html
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// $Id$
//
require_once('owa_env.php');
/**
* OWA Base Class
*
* @author Peter Adams <[email protected]>
* @copyright Copyright © 2006 Peter Adams <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GPL v2.0
* @category owa
* @package owa
* @version $Revision$
* @since owa 1.0.0
*/
class owa_base {
/**
* Configuration
*
* @var array
*/
var $config;
/**
* Error Logger
*
* @var object
*/
var $e;
/**
* Configuration Entity
*
* @var owa_settings Object global configuration object
*/
var $c;
/**
* Module that this class belongs to
*
* @var unknown_type
*/
var $module;
/**
* Request Params
*
* @var array
*/
var $params;
/**
* Base Constructor
*
* @return owa_base
*/
function __construct() {
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
$this->e = owa_coreAPI::errorSingleton();
$this->c = owa_coreAPI::configSingleton();
$this->config = $this->c->fetch('base');
}
/**
* Retrieves string message from mesage file
*
* @param integer $code
* @param string $s1
* @param string $s2
* @param string $s3
* @param string $s4
* @return string
*/
function getMsg($code, $s1 = null, $s2 = null, $s3 = null, $s4 = null) {
static $_owa_messages;
if (empty($_owa_messages)) {
require_once(OWA_DIR.'conf/messages.php');
}
switch ($_owa_messages[$code][1]) {
case 0:
$msg = $_owa_messages[$code][0];
break;
case 1:
$msg = sprintf($_owa_messages[$code][0], $s1);
break;
case 2:
$msg = sprintf($_owa_messages[$code][0], $s1, $s2);
break;
case 3:
$msg = sprintf($_owa_messages[$code][0], $s1, $s2, $s3);
break;
case 4:
$msg = sprintf($_owa_messages[$code][0], $s1, $s2, $s3, $s4);
break;
}
return $msg;
}
/**
* Sets object attributes
*
* @param unknown_type $array
*/
function _setObjectValues($array) {
foreach ($array as $n => $v) {
$this->$n = $v;
}
return;
}
/**
* Sets array attributes
*
* @param unknown_type $array
*/
function _setArrayValues($array) {
foreach ($array as $n => $v) {
$this->params['$n'] = $v;
}
return;
}
function __destruct() {
owa_coreAPI::profile($this, __FUNCTION__, __LINE__);
}
}
?>