update realip log
[brisk.git] / web / spush / brisk-spush.php
1 #!/usr/bin/php
2 <?php
3 /*
4  *  brisk - spush/brisk-spush.php
5  *
6  *  Copyright (C) 2012 Matteo Nastasi
7  *                          mailto: nastasi@alternativeoutput.it 
8  *                                  matteo.nastasi@milug.org
9  *                          web: http://www.alternativeoutput.it
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * General Public License for more details. You should have received a
20  * copy of the GNU General Public License along with this program; if
21  * not, write to the Free Software Foundation, Inc, 59 Temple Place -
22  * Suite 330, Boston, MA 02111-1307, USA.
23  *
24  */
25
26 $G_base = "../";
27
28 require_once($G_base."Obj/sac-a-push.phh");
29 require_once("./brisk-spush.phh");
30 require_once($G_base."Obj/user.phh");
31 @include_once($G_base."Obj/curl-de-brisk.phh");
32 require_once($G_base."Obj/brisk.phh");
33 require_once($G_base."Obj/auth.phh");
34 require_once($G_base."Obj/zlibstream.phh");
35 require_once($G_base."Obj/mail.phh");
36 require_once($G_base."Obj/provider_proxy.phh");
37 require_once($G_base."index.php");
38 require_once($G_base."index_wr.php");
39 require_once($G_base."briskin5/Obj/briskin5.phh");
40 require_once($G_base."briskin5/index.php");
41 require_once($G_base."briskin5/index_wr.php");
42
43
44 function main($argv)
45 {
46     GLOBAL $G_ban_list, $G_black_list, $G_cloud_smasher, $G_provider_proxy;
47
48     pid_save();
49     do {
50         if (($brisk = Brisk::create(LEGAL_PATH."/brisk-crystal.data", $G_ban_list, $G_black_list, $G_cloud_smasher, $G_provider_proxy)) == FALSE) {
51             log_crit("Brisk::create failed");
52             $ret = 1;
53             break;
54         }
55
56         if (($s_a_p = Sac_a_push::create($brisk, USOCK_PATH, 0, 0, $argv)) === FALSE) {
57             $ret = 2;
58             break;
59         }
60
61         $ret = $s_a_p->run();
62     } while (0);
63
64     pid_remove();
65     exit($ret);
66 }
67
68 main($argv);
69 ?>