Хранилища Subversion ant

Редакция

Редакция 309 | Редакция 313 | К новейшей редакции | Только различия | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS

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