diff --git a/app/library/App/Bootstrap/RouteBootstrap.php b/app/library/App/Bootstrap/RouteBootstrap.php index 619f306..edc5f26 100755 --- a/app/library/App/Bootstrap/RouteBootstrap.php +++ b/app/library/App/Bootstrap/RouteBootstrap.php @@ -50,61 +50,6 @@ class RouteBootstrap implements BootstrapInterface $view->setVar('documentationPath', $config->hostName . '/export/documentation.json'); return $view->render('general/documentation'); }); - - $api->get('/test.html', function() use ($api) { - - /** @var \Phalcon\Mvc\View\Simple $view */ - $view = $api->di->get(Services::VIEW); - - putenv('GOOGLE_APPLICATION_CREDENTIALS=/var/www/phalcon/ca4a1bd8aa14.json'); - $client = new Google_Client(); - $client->useApplicationDefaultCredentials(); - $client->setScopes(['https://www.googleapis.com/auth/analytics.readonly']); - $analytics = new Google_Service_AnalyticsReporting($client); - - $param[] = ['metric' => 'ga:sessions', 'alias' => 'Сессии']; - $param[] = ['metric' => 'ga:users', 'alias' => 'Пользователи']; - //$param[] = ['metric' => 'ga:CTR', 'alias' => 'CTR']; - //$param[] = ['metric' => 'ga:goal1Value', 'alias' => 'цель "Корзина"']; - - $VIEW_ID = "119240817"; - - foreach ($param as $item) { - - // Создание объекта DateRange. - $dateRange = new Google_Service_AnalyticsReporting_DateRange(); - $dateRange->setStartDate("30daysAgo"); - $dateRange->setEndDate("today"); - - // Создание объекта Metrics. - $sessions = new Google_Service_AnalyticsReporting_Metric(); - $sessions->setExpression($item['metric']); - $sessions->setAlias($item['alias']); - - - // Создание объекта ReportRequest. - $request = new Google_Service_AnalyticsReporting_ReportRequest(); - $request->setViewId($VIEW_ID); - $request->setDateRanges($dateRange); - $request->setMetrics(array($sessions)); - - $body = new Google_Service_AnalyticsReporting_GetReportsRequest(); - $body->setReportRequests( array( $request) ); - - $response = $analytics->reports->batchGet( $body ); - } - - - $var_2 = var_dump($response); - - $msg = "testing fine"; - - return $view->render('general/test', [ - 'var1' => $msg, - 'var2' => $var_2 - ]); - }); } - } \ No newline at end of file diff --git a/app/library/App/Controllers/ExportController.php b/app/library/App/Controllers/ExportController.php index c11d552..3a96f79 100755 --- a/app/library/App/Controllers/ExportController.php +++ b/app/library/App/Controllers/ExportController.php @@ -20,8 +20,6 @@ class ExportController extends CollectionController $documentation->addManyCollections($this->application->getCollections()); $documentation->addManyRoutes($this->application->getRouter()->getRoutes()); - var_dump($documentation->getRoutes()); - return $this->createItemResponse($documentation, new DocumentationTransformer(), 'documentation'); } -- libgit2 0.21.4