Хранилища Subversion ant

Редакция

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

Редакция 461 Редакция 475
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
define('ROOT', dirname(__FILE__));
15
define('ROOT', dirname(__FILE__));
16
16
17
require_once ROOT."/lib/config.php";
17
require_once ROOT."/lib/config.php";
18
require_once ROOT."/lib/DB.php";
18
require_once ROOT."/lib/DB.php";
19
require_once ROOT."/lib/template.php";
19
require_once ROOT."/lib/template.php";
20
require_once ROOT."/lib/core.php";
20
require_once ROOT."/lib/core.php";
21
require_once ROOT."/lib/security.php";
21
require_once ROOT."/lib/security.php";
22
22
23
$dsn = array(
23
$dsn = array(
24
    'phptype'   => 'mysql',
24
    'phptype'   => 'mysql',
25
    'username'  => DBUSER,
25
    'username'  => DBUSER,
26
    'password'  => DBPASS,
26
    'password'  => DBPASS,
27
    'hostspec'  => DBHOST,
27
    'hostspec'  => DBHOST,
28
    'database'  => DBNAME,
28
    'database'  => DBNAME,
29
);
29
);
30
30
31
$options = array(
31
$options = array(
32
    'debug'         => 2,
32
    'debug'         => 2,
33
    'portability'   => 'DB_PORTABILITY_ALL',
33
    'portability'   => 'DB_PORTABILITY_ALL',
34
);
34
);
35
35
36
$db =& DB::connect($dsn, $options);
36
$db =& DB::connect($dsn, $options);
37
if (PEAR::isError($db)) {
37
if (PEAR::isError($db)) {
38
    die($db->getMessage());
38
    die($db->getMessage());
39
}
39
}
40
40
41
$db->setFetchMode(DB_FETCHMODE_ASSOC);
41
$db->setFetchMode(DB_FETCHMODE_ASSOC);
42
$query =& $db->query("SET NAMES utf8");
42
$query =& $db->query("SET NAMES utf8");
43
43
44
$cookie = "asHash";
44
$cookie = "asHash";
45
$webroot = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/";
45
$webroot = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/";
46
46
47
$secure = new Security();
47
$secure = new Security();
48
$core   = new Core($db, PREFIX, $secure, $cookie);
48
$core   = new Core($db, PREFIX, $secure, $cookie);
49
$tmpl   = new Template(ROOT."/templates/");
49
$tmpl   = new Template(ROOT."/templates/");
50
50
51
$tmpl->assign('host',$webroot);
51
$tmpl->assign('host',$webroot);
52
$tmpl->assign('header',$core->getEngineAttr('codename'));
52
$tmpl->assign('header',$core->getEngineAttr('codename'));
53
$tmpl->assign('engine',$core->getEngineAttr('codename')." ".$core->getEngineAttr('version'));
53
$tmpl->assign('engine',$core->getEngineAttr('codename')." ".$core->getEngineAttr('version'));
54
$tmpl->assign('description',$core->getEngineAttr('description'));
54
$tmpl->assign('description',$core->getEngineAttr('description'));
55
55
56
?>
56
?>
57
 
57