Upgraded drupal core with security updates
[yaffs-website] / web / core / scripts / rebuild_token_calculator.sh
1 #!/usr/bin/env php
2 <?php
3
4 /**
5  * @file
6  * Command line token calculator for rebuild.php.
7  */
8
9 use Drupal\Component\Utility\Crypt;
10 use Drupal\Core\DrupalKernel;
11 use Drupal\Core\Site\Settings;
12 use Symfony\Component\HttpFoundation\Request;
13
14 if (PHP_SAPI !== 'cli') {
15   return;
16 }
17
18 require __DIR__ . '/../../autoload.php';
19 require_once __DIR__ . '/../includes/bootstrap.inc';
20
21 $request = Request::createFromGlobals();
22 Settings::initialize(DrupalKernel::findSitePath($request));
23
24 $timestamp = time();
25 $token = Crypt::hmacBase64($timestamp, Settings::get('hash_salt'));
26
27 print "timestamp=$timestamp&token=$token\n";