Редакция 309 | Редакция 313 | К новейшей редакции | Содержимое файла | Сравнить с предыдущей | Последнее изменение | Открыть журнал | RSS
Редакция | Автор | № строки | Строка |
---|---|---|---|
304 | alex-w | 1 | <?php |
2 | |||
3 | /** |
||
4 | * |
||
5 | * Codename: ant-ng - generator of sources.list for Debian and |
||
6 | * distributives, based on Debian |
||
7 | * http://alex-w.org.ru/p/antng/ |
||
8 | * |
||
9 | * Copyright (c) 2009 Alexander Wolf |
||
10 | * Dual licensed under the MIT and GNU LGPL licenses. |
||
11 | * http://alex-w.org.ru/p/antng/license |
||
12 | * |
||
13 | */ |
||
14 | |||
15 | class Core { |
||
308 | alex-w | 16 | protected $db = NULL; |
17 | protected $prefix = NULL; |
||
309 | alex-w | 18 | protected $secure = NULL; |
19 | protected $owner = NULL; |
||
304 | alex-w | 20 | |
309 | alex-w | 21 | |
312 | alex-w | 22 | function __constructor($database,$prefix,$secure) { |
308 | alex-w | 23 | $this->db = $database; |
24 | $this->prefix = $prefix; |
||
312 | alex-w | 25 | $this->secure = $secure; |
307 | alex-w | 26 | } |
27 | |||
308 | alex-w | 28 | function getSetting($attr) { |
29 | $db = $this->db; |
||
30 | $result = array(); |
||
31 | $query = "SELECT optvalue FROM ".$this->prefix."settings WHERE opt='".$attr."'"; |
||
32 | $rq =& $db->query($query); |
||
33 | if ($rq->numRows()!=0) { |
||
34 | $rq->fetchInto($element); |
||
35 | $result["ERR"] = 0; |
||
36 | $result["OptValue"] = $element["optvalue"]; |
||
37 | } else { |
||
38 | $result["ERR"] = 1; |
||
39 | $result["ERRINFO"] = "Empty result"; |
||
40 | } |
||
41 | return $result; |
||
42 | } |
||
43 | |||
304 | alex-w | 44 | } |
45 | |||
46 | ?> |