Хранилища Subversion ant

Редакция

Редакция 312 | Редакция 314 | К новейшей редакции | Содержимое файла | Сравнить с предыдущей | Последнее изменение | Открыть журнал | 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;
313 alex-w 18
    protected $secure   = NULL;    
304 alex-w 19
 
309 alex-w 20
 
312 alex-w 21
    function __constructor($database,$prefix,$secure) {
308 alex-w 22
        $this->db       = $database;
23
        $this->prefix   = $prefix;
312 alex-w 24
        $this->secure   = $secure;        
307 alex-w 25
    }
26
 
308 alex-w 27
    function getSetting($attr) {
28
        $db = $this->db;
29
        $result = array();
30
        $query = "SELECT optvalue FROM ".$this->prefix."settings WHERE opt='".$attr."'";
31
        $rq =& $db->query($query);
32
        if ($rq->numRows()!=0) {
33
            $rq->fetchInto($element);
34
            $result["ERR"] = 0;
35
            $result["OptValue"] = $element["optvalue"];
36
        } else {
37
            $result["ERR"] = 1;
38
            $result["ERRINFO"] = "Empty result";
39
        }
40
        return $result;
41
    }
42
 
304 alex-w 43
}
44
 
45
?>