<?php /** * отладка подключения к yndex/search/xlm */ 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__ . '/yandexConfig.php'; include_once __DIR__ . '/local.php'; $taskPar = TaskParameters::getInstance(); $taskPar->setParameter('query', 'оренбург'); $yandex = new YandexController(); $yandex->setQuery('оренбург'); $yandex->setPage(1); $yandex->queryGo(); $error = $yandex->getError(); $result = $yandex->getResultsForShow(); //$passages = $rrSimple['passages'] ; //$passage = $passages[0] ; //$pass = Yandex::highlight($passage) ; var_dump($result);
$answ = $reqGo->getResult(); //----------------------------------- $requestResult = $answ['result']; // 2 шаг - определить тип $rType = new RequestType(); $rType->init(); $rType->setResultRequest($requestResult); $rType->typeRulesClc(); $answ['requestTypes'] = $rType->getRequestTypes(); break; case 'yandex': // запрос к информ системе 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();