Loading src/Plugin/Block/CounterBlock.php +5 −5 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -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; Loading Loading
src/Plugin/Block/CounterBlock.php +5 −5 Original line number Diff line number Diff line Loading @@ -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(); Loading @@ -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; Loading