Редакция 363 | Редакция 365 | К новейшей редакции | Содержимое файла | Сравнить с предыдущей | Последнее изменение | Открыть журнал | RSS
Редакция | Автор | № строки | Строка |
---|---|---|---|
304 | alex-w | 1 | <?php |
2 | |||
3 | /** |
||
4 | * |
||
5 | * Codename: ant-ng - generator of sources.list for Debian and |
||
6 | * distributives, based on Debian |
||
7 | * http://alex-w.org.ru/p/antng/ |
||
8 | * |
||
9 | * Copyright (c) 2009 Alexander Wolf |
||
10 | * Dual licensed under the MIT and GNU LGPL licenses. |
||
11 | * http://alex-w.org.ru/p/antng/license |
||
12 | * |
||
13 | */ |
||
14 | |||
15 | define('ROOT', dirname(__FILE__)); |
||
16 | |||
17 | require_once ROOT."/lib/config.php"; |
||
18 | require_once ROOT."/lib/DB.php"; |
||
363 | alex-w | 19 | //require_once ROOT."/lib/Smarty.class.php"; |
304 | alex-w | 20 | require_once ROOT."/lib/core.php"; |
311 | alex-w | 21 | require_once ROOT."/lib/security.php"; |
304 | alex-w | 22 | |
23 | $dsn = array( |
||
24 | 'phptype' => 'mysql', |
||
25 | 'username' => DBUSER, |
||
26 | 'password' => DBPASS, |
||
27 | 'hostspec' => DBHOST, |
||
28 | 'database' => DBNAME, |
||
29 | ); |
||
30 | |||
31 | $options = array( |
||
32 | 'debug' => 2, |
||
33 | 'portability' => 'DB_PORTABILITY_ALL', |
||
34 | ); |
||
35 | |||
36 | $db =& DB::connect($dsn, $options); |
||
37 | if (PEAR::isError($db)) { |
||
38 | die($db->getMessage()); |
||
39 | } |
||
40 | |||
41 | $db->setFetchMode(DB_FETCHMODE_ASSOC); |
||
42 | $query =& $db->query("SET NAMES utf8"); |
||
43 | |||
359 | alex-w | 44 | $cookie = "asHash"; |
45 | |||
309 | alex-w | 46 | $secure = new Security(); |
359 | alex-w | 47 | $core = new Core($db, PREFIX, $secure, $cookie); |
364 | alex-w | 48 | $tmpl = new Template(ROOT."/templates/"); |
49 | //TODO Вместо Smarty лучше написать свой очень простой шаблонизатор - монстра использовать не целесообразно |
||
304 | alex-w | 50 | |
51 | ?> |