Хранилища Subversion ant

Редакция

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

Редакция 312 Редакция 313
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;
-
 
20
19
21
20
22
    function __constructor($database,$prefix,$secure) {
21
    function __constructor($database,$prefix,$secure) {
23
        $this->db       = $database;
22
        $this->db       = $database;
24
        $this->prefix   = $prefix;
23
        $this->prefix   = $prefix;
25
        $this->secure   = $secure;        
24
        $this->secure   = $secure;        
26
    }
25
    }
27
26
28
    function getSetting($attr) {
27
    function getSetting($attr) {
29
        $db = $this->db;
28
        $db = $this->db;
30
        $result = array();
29
        $result = array();
31
        $query = "SELECT optvalue FROM ".$this->prefix."settings WHERE opt='".$attr."'";
30
        $query = "SELECT optvalue FROM ".$this->prefix."settings WHERE opt='".$attr."'";
32
        $rq =& $db->query($query);
31
        $rq =& $db->query($query);
33
        if ($rq->numRows()!=0) {
32
        if ($rq->numRows()!=0) {
34
            $rq->fetchInto($element);
33
            $rq->fetchInto($element);
35
            $result["ERR"] = 0;
34
            $result["ERR"] = 0;
36
            $result["OptValue"] = $element["optvalue"];
35
            $result["OptValue"] = $element["optvalue"];
37
        } else {
36
        } else {
38
            $result["ERR"] = 1;
37
            $result["ERR"] = 1;
39
            $result["ERRINFO"] = "Empty result";
38
            $result["ERRINFO"] = "Empty result";
40
        }
39
        }
41
        return $result;
40
        return $result;
42
    }
41
    }
43
42
44
}
43
}
45
44
46
?>
45
?>
47
 
46