src/snac/server/ServerExecutor.php
/**
     * Record Analytics by Domain
     *
     * Record outgoing link traffic hit
     *
     * @param string[] $input Input array from the Server object
     */
Record Analytics by Domain
Record outgoing link traffic hit

@param string[] $input Input array from the Server object
Record Analytics by Domain Record outgoing link traffic hit @param string [] $input Input array from the Server object
public function readAnalytics($input) {
        if ($input["domain"]) {
            $analyticsName = $input["domain"];
            $visits = $this->cStore->readAnalyticsByDomain($input["domain"]) ?? "";
        } elseif ($input["repo_ic_id"]) {
            $analyticsName = $input["name"];
            $repoICID = $input["repo_ic_id"];
            $visits = $this->cStore->readAnalyticsByRepo($repoICID);
        }
        if (!isset($visits)) {
            return ["result" => "failure"];
        }
            $trafficData = ["result" => "success"];
            $trafficData["analytics_name"] = $analyticsName;
            $trafficData["dates"]  = json_encode($visits[0]);
            $trafficData["counts"] = json_encode($visits[1]);
            $trafficData["total"] = json_encode($visits[2]["Total"]);
        return $trafficData;
    }
public function readAnalytics ( $ input ) { if ( $ input [ " domain " ] ) { $ analyticsName = $ input [ " domain " ] ; $ visits = $ this -> cStore -> readAnalyticsByDomain ( $ input [ " domain " ] ) ?? " " ; } elseif ( $ input [ " repo_ic_id " ] ) { $ analyticsName = $ input [ " name " ] ; $ repoICID = $ input [ " repo_ic_id " ] ; $ visits = $ this -> cStore -> readAnalyticsByRepo ( $ repoICID ) ; } if ( ! isset ( $ visits ) ) { return [ " result " => " failure " ] ; } $ trafficData = [ " result " => " success " ] ; $ trafficData [ " analytics_name " ] = $ analyticsName ; $ trafficData [ " dates " ] = json_encode ( $ visits [ 0 ] ) ; $ trafficData [ " counts " ] = json_encode ( $ visits [ 1 ] ) ; $ trafficData [ " total " ] = json_encode ( $ visits [ 2 ] [ " Total " ] ) ; return $ trafficData ; }
Record Analytics by Domain
 Record outgoing link traffic hit
Record Analytics by Domain Record outgoing link traffic hit