Хранилища Subversion kbase

Редакция

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

Редакция 28 Редакция 29
1
<?php
1
<?php
2
2
3
/**
3
/**
4
 *  KBase  
4
 *  KBase  
5
 *  http://alex-w.org.ru/p/kbase/
5
 *  http://alex-w.org.ru/p/kbase/
6
 *
6
 *
7
 *  Copyright (c) 2009 Alexander Wolf
7
 *  Copyright (c) 2009 Alexander Wolf
8
 *  Dual licensed under the MIT and GNU LGPL licenses.
8
 *  Dual licensed under the MIT and GNU LGPL licenses.
9
 *  http://alex-w.org.ru/p/kbase/license
9
 *  http://alex-w.org.ru/p/kbase/license
10
 *
10
 *
11
 */
11
 */
12
12
13
require_once dirname(__FILE__)."/config.inc.php";
13
require_once dirname(__FILE__)."/config.inc.php";
14
require_once ROOT."/libs/DB.php";
14
require_once ROOT."/libs/DB.php";
15
require_once ROOT."/libs/core.php";
15
require_once ROOT."/libs/core.php";
16
require_once ROOT."/libs/theme.php";
16
require_once ROOT."/libs/theme.php";
17
require_once ROOT."/libs/auth.php";
17
require_once ROOT."/libs/auth.php";
18
18
19
$dsn = array(
19
$dsn = array(
20
        'phptype'       => 'mysql',
20
        'phptype'       => 'mysql',
21
        'username'      => DBUSER,
21
        'username'      => DBUSER,
22
        'password'      => DBPASS,
22
        'password'      => DBPASS,
23
        'hostspec'      => DBHOST,
23
        'hostspec'      => DBHOST,
24
        'database'      => DBNAME,
24
        'database'      => DBNAME,
25
);
25
);
26
$options = array(
26
$options = array(
27
        'debug'         => 2,
27
        'debug'         => 2,
28
        'portability'   => DB_PORTABILITY_ALL,
28
        'portability'   => DB_PORTABILITY_ALL,
29
);
29
);
30
30
31
$db =& DB::connect($dsn, $options);
31
$db =& DB::connect($dsn, $options);
32
if (PEAR::isError($db)) {
32
if (PEAR::isError($db)) {
33
    die($db->getMessage());
33
    die($db->getMessage());
34
}
34
}
35
$db->setFetchMode(DB_FETCHMODE_ASSOC);
35
$db->setFetchMode(DB_FETCHMODE_ASSOC);
36
$query =& $db->query("SET NAMES utf8");
36
$query =& $db->query("SET NAMES utf8");
37
37
38
setlocale(LC_MESSAGES, KBLANG);
38
setlocale(LC_MESSAGES, KBLANG);
39
bindtextdomain(LDOMAIN, ROOT."/locale");
39
bindtextdomain(LDOMAIN, ROOT."/locale");
40
textdomain(LDOMAIN);
40
textdomain(LDOMAIN);
41
bind_textdomain_codeset(LDOMAIN, 'UTF-8');
41
bind_textdomain_codeset(LDOMAIN, 'UTF-8');
42
42
43
$core   = new Core;
43
$core   = new Core;
44
$theme  = new Theme;
44
$theme  = new Theme;
45
$auth   = new Auth;
45
$auth   = new Auth;
46
46
-
 
47
$cookie["sign"] = "_kbSign";
-
 
48
$cookie["hash"] = "_kbHash";
-
 
49
47
?>
50
?>
48
 
51