Commit 69566e87 authored by Gaurav Kapoor's avatar Gaurav Kapoor Committed by Gaurav Kapoor
Browse files

Issue #3264197 by gaurav.kapoor: Fix CS issues, internal documentation, remove...

Issue #3264197 by gaurav.kapoor: Fix CS issues, internal documentation, remove deprecated functions and refactor code
parent d4005c8c
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -135,10 +135,10 @@ class CounterBlock extends BlockBase implements ContainerFactoryPluginInterface
    $counter_statistic_week         = $config->get('counter_statistic_week');
    $counter_statistic_month        = $config->get('counter_statistic_month');
    $counter_statistic_year         = $config->get('counter_statistic_year');
    $ip                             = $this->requestStack->getClientIp();
    $counter_svr_ip                 = $this->requestStack->server->get('SERVER_ADDR');
    $ip                             = $this->requestStack->getCurrentRequest()->getClientIp();
    $counter_svr_ip                 = $this->requestStack->getCurrentRequest()->server->get('SERVER_ADDR');
    $created                        = \time();
    $url                            = Html::escape($this->requestStack->getRequestUri());
    $url                            = Html::escape($this->requestStack->getCurrentRequest()->getRequestUri());

    // Counter_insert_delay.
    $db_types = $this->database->driver();
@@ -163,11 +163,11 @@ class CounterBlock extends BlockBase implements ContainerFactoryPluginInterface
    $data_update = ($interval >= $counter_refresh_delay ? 1 : 0);

    // Uid, nid, type, browser name, browser version, platform.
    $node = $this->requestStack->attributes->get('node');
    $node = $this->requestStack->getCurrentRequest()->attributes->get('node');
    $nid = 0;
    $type = '';
    $account = $this->account;
    $path_args = \explode('/', $this->requestStack->getRequestUri());
    $path_args = \explode('/', $this->requestStack->getCurrentRequest()->getRequestUri());
    if ($path_args[0] == 'node' && is_numeric($path_args[1])) {
      $nid  = $node->nid;
      $type = $node->type;