Move all files to 2017/
This commit is contained in:
parent
ac7370f67f
commit
2875863330
15717 changed files with 0 additions and 0 deletions
|
@ -1,30 +0,0 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Handles counts of node views via AJAX with minimal bootstrap.
|
||||
*/
|
||||
|
||||
use Drupal\Core\DrupalKernel;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
chdir('../../..');
|
||||
|
||||
$autoloader = require_once 'autoload.php';
|
||||
|
||||
$kernel = DrupalKernel::createFromRequest(Request::createFromGlobals(), $autoloader, 'prod');
|
||||
$kernel->boot();
|
||||
$container = $kernel->getContainer();
|
||||
|
||||
$views = $container
|
||||
->get('config.factory')
|
||||
->get('statistics.settings')
|
||||
->get('count_content_views');
|
||||
|
||||
if ($views) {
|
||||
$nid = filter_input(INPUT_POST, 'nid', FILTER_VALIDATE_INT);
|
||||
if ($nid) {
|
||||
$container->get('request_stack')->push(Request::createFromGlobals());
|
||||
$container->get('statistics.storage.node')->recordView($nid);
|
||||
}
|
||||
}
|
Reference in a new issue