Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ui-test.php « config « SEO « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e4a193928ba28068376fecee703e4c6e32a89764 (plain)
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
<?php

use Piwik\Container\StaticContainer;

return array(
    'observers.global' => \DI\add([
        ['Http.sendHttpRequest',\DI\value(function ($aUrl, $httpEventParams, &$response, &$status, &$headers) {
            // fake responses for SEO metric requests
            if (strpos($aUrl, 'www.alexa.com') ) {
                $response = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/SEO/tests/resources/alexa_response.html');
            } elseif (strpos($aUrl, 'www.bing.com') ) {
                $response = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/SEO/tests/resources/bing_response.html');
            } elseif (strpos($aUrl, 'archive.org') ) {
                $response = '{"timestamp": "19900101", "url": "matomo.org", "archived_snapshots": {"closest": {"timestamp": "20180109155124", "available": true, "status": "200", "url": "http://web.archive.org/web/20180109155124/https://matomo.org"}}}';
            } elseif (strpos($aUrl, 'www.who.is') ) {
                $response = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/SEO/tests/resources/whois_response.html');
            } elseif (strpos($aUrl, 'www.whois.com') ) {
                $response = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/SEO/tests/resources/whoiscom_response.html');
            } elseif (strpos($aUrl, 'www.google.com') ) {
                $response = file_get_contents(PIWIK_INCLUDE_PATH . '/plugins/SEO/tests/resources/google_response.html');
            }
        })]
    ]),

);