This repository has been archived by the owner on Dec 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
64 lines (49 loc) · 2.36 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
namespace Smalex86\VkInviter;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
include_once __DIR__ . '/vendor/autoload.php';
include_once __DIR__ . '/config.php';
use Smalex86\Common\Logger;
Logger::setLogFolder(__DIR__ . '/logs/');
$logger = new Logger();
$logger->toLogD(3, __FILE__ . ' : ' . __LINE__ . ' -- POST = ' . var_export($_POST, true),
'getpost.log');
$logger->toLogD(3, __FILE__ . ' : ' . __LINE__ . ' -- GET = ' . var_export($_GET, true),
'getpost.log');
$logger->toLogD(3, __FILE__ . ' : ' . __LINE__ . ' -- file_get_contents = '
. var_export(file_get_contents("php://input"), true), 'getpost.log');
$application = new inviterServer(); // создание сервера
$application->startActionManager(); // запуск обработки пост-данных
$application->startPageBuilder(); // запуск построения страницы
//include('templates/main/index.php');
include('templates/dashboard/index.php');
/* --------------------------------------- Работа с токеном -------------- */
// анализируем get запрос
//if (isset($_GET['code'])) {
// var_dump($_GET['code']);
// // если пришел запрос на формирование токена
// // то формируем ссылку на получение токена и выполняем по ней переход
// $inviterServer->setNewToken($_GET['code']);
//}
//if (($checkToken = $inviterServer->checkToken()) !== true) {
// // проблема с токеном, делаем запрос на получение нового
// //echo $checkToken . " \n";
//}
/* --------------------------------------- Работа с токеном (конец) ------ */
// init
//if (isset($_GET['init'])) {
// $botServer->initUserList();
//}
// команда "выдать 20 ссылок на страницы новых пользователей"
//if (isset($_GET['get20users'])) {
// // получить
//}
//echo "<p>I am working. </p>\n";
//if ($inviterServer->getToken()) {
//echo "<p>I've got working token! </p>\n";
//echo "<p><a href='vkbot.php?get20users'>Получить список ссылок на профили 20 новых пользователей</a></p>";
//}