6 * Command line token calculator for rebuild.php.
9 use Drupal\Component\Utility\Crypt;
10 use Drupal\Core\DrupalKernel;
11 use Drupal\Core\Site\Settings;
12 use Symfony\Component\HttpFoundation\Request;
14 if (PHP_SAPI !== 'cli') {
18 require __DIR__ . '/../../autoload.php';
19 require_once __DIR__ . '/../includes/bootstrap.inc';
21 $request = Request::createFromGlobals();
22 Settings::initialize(DrupalKernel::findSitePath($request));
25 $token = Crypt::hmacBase64($timestamp, Settings::get('hash_salt'));
27 print "timestamp=$timestamp&token=$token\n";