Редакция 524 | Только различия | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 524 | Редакция 554 | ||
---|---|---|---|
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 apt-distributives
|
6 | * distributives, based on Debian
|
- | |
7 | * http://alex-w.org.ru/p/antng/
|
6 | * http://alex-w.org.ru/p/antng/
|
8 | *
|
7 | *
|
9 | * Copyright (c) 2009 Alexander Wolf
|
8 | * Copyright (c) 2009 Alexander Wolf
|
10 | * Dual licensed under the MIT and GNU LGPL licenses.
|
9 | * Dual licensed under the MIT and GNU LGPL licenses.
|
11 | * http://alex-w.org.ru/p/antng/license
|
10 | * http://alex-w.org.ru/p/antng/license
|
12 | *
|
11 | *
|
13 | */
|
12 | */
|
14 | 13 | ||
15 | define('ROOT', dirname(__FILE__)); |
14 | define('ROOT', dirname(__FILE__)); |
16 | 15 | ||
17 | require_once ROOT."/lib/config.php"; |
16 | require_once ROOT."/lib/config.php"; |
18 | require_once ROOT."/lib/DB.php"; |
17 | require_once ROOT."/lib/DB.php"; |
19 | require_once ROOT."/lib/template.php"; |
18 | require_once ROOT."/lib/template.php"; |
20 | require_once ROOT."/lib/core.php"; |
19 | require_once ROOT."/lib/core.php"; |
21 | require_once ROOT."/lib/security.php"; |
20 | require_once ROOT."/lib/security.php"; |
22 | 21 | ||
23 | $dsn = array( |
22 | $dsn = array( |
24 | 'phptype' => 'mysql', |
23 | 'phptype' => 'mysql', |
25 | 'username' => DBUSER, |
24 | 'username' => DBUSER, |
26 | 'password' => DBPASS, |
25 | 'password' => DBPASS, |
27 | 'hostspec' => DBHOST, |
26 | 'hostspec' => DBHOST, |
28 | 'database' => DBNAME, |
27 | 'database' => DBNAME, |
29 | ); |
28 | ); |
30 | 29 | ||
31 | $options = array( |
30 | $options = array( |
32 | 'debug' => 2, |
31 | 'debug' => 2, |
33 | 'portability' => 'DB_PORTABILITY_ALL', |
32 | 'portability' => 'DB_PORTABILITY_ALL', |
34 | ); |
33 | ); |
35 | 34 | ||
36 | $db =& DB::connect($dsn, $options); |
35 | $db =& DB::connect($dsn, $options); |
37 | if (PEAR::isError($db)) { |
36 | if (PEAR::isError($db)) { |
38 | die($db->getMessage()); |
37 | die($db->getMessage()); |
39 | }
|
38 | }
|
40 | 39 | ||
41 | $db->setFetchMode(DB_FETCHMODE_ASSOC); |
40 | $db->setFetchMode(DB_FETCHMODE_ASSOC); |
42 | $query =& $db->query("SET NAMES utf8"); |
41 | $query =& $db->query("SET NAMES utf8"); |
43 | 42 | ||
44 | $cookie = "asHash"; |
43 | $cookie = "asHash"; |
45 | $webroot = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/"; |
44 | $webroot = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/"; |
46 | $manager = "./manager.php"; |
45 | $manager = "./manager.php"; |
47 | $process = "./process.php"; |
46 | $process = "./process.php"; |
48 | $picture = ROOT."/img/d/"; |
47 | $picture = ROOT."/img/d/"; |
49 | 48 | ||
50 | $secure = new Security(); |
49 | $secure = new Security(); |
51 | $core = new Core($db, PREFIX, $secure, $cookie); |
50 | $core = new Core($db, PREFIX, $secure, $cookie); |
52 | $tmpl = new Template(ROOT."/templates/"); |
51 | $tmpl = new Template(ROOT."/templates/"); |
53 | 52 | ||
54 | $tmpl->assign('host',$webroot); |
53 | $tmpl->assign('host',$webroot); |
55 | $tmpl->assign('header',$core->getEngineAttr('codename')); |
54 | $tmpl->assign('header',$core->getEngineAttr('codename')); |
56 | $tmpl->assign('engine',$core->getEngineAttr('codename')." ".$core->getEngineAttr('version')); |
55 | $tmpl->assign('engine',$core->getEngineAttr('codename')." ".$core->getEngineAttr('version')); |
57 | $tmpl->assign('description',$core->getEngineAttr('description')); |
56 | $tmpl->assign('description',$core->getEngineAttr('description')); |
58 | 57 | ||
59 | ?>
|
58 | ?>
|
60 | 59 |