<?php /** * проверка MainProjects */ ini_set('display_errors', 1); error_reporting(E_ALL ^ E_NOTICE); header('Content-type: text/html; charset=utf-8'); setlocale(LC_ALL, "ru_RU.UTF-8"); mb_internal_encoding("UTF-8"); include_once __DIR__ . '/local.php'; $taskPar = TaskParameters::getInstance(); $taskPar->setParameter('query', 'оренбург'); $mp = new MainProjects(); $mp->setQuery('акриловая краска'); $mp->setCity('1', 'Челябинск', '74'); $mp->projectsGo(); $result = $mp->getResult(); echo json_last_error(); //$passages = $rrSimple['passages'] ; //$passage = $passages[0] ; //$pass = Yandex::highlight($passage) ; var_dump($result); echo json_encode($result);
// запрос к информ системе yandex $query = $taskPar->getParameter('query'); $page = $taskPar->getParameter('page'); $yandex = new YandexController(); $yandex->setQuery($query); $yandex->setPage($page); $yandex->queryGo(); $answ = $yandex->getResultsForShow(); break; case 'mainProjects': // запрос к основным проектам $query = $taskPar->getParameter('query'); $cityId = $taskPar->getParameter('cityId'); $cityName = $taskPar->getParameter('cityName'); $regionId = $taskPar->getParameter('regionId'); $mp = new MainProjects(); $mp->setQuery($query); $mp->setCity($cityId, $cityName, $regionId); $mp->projectsGo(); $answ = $mp->getResult(); break; case 'getAddSignals': // дполнительные сигналы $signal = new AddSignals(); $result = $signal->getSignals(); $answ = ['successful' => true, 'result' => $result]; break; case 'getThoughts': // мысли $thoughts = new Thoughts(); $result = $thoughts->getThoughts();