Хранилища Subversion ant

Редакция

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