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