Mercurial > hg > isophonics-drupal-site
view core/scripts/rebuild_token_calculator.sh @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line source
#!/usr/bin/env php <?php /** * @file * Command line token calculator for rebuild.php. */ use Drupal\Component\Utility\Crypt; use Drupal\Core\DrupalKernel; use Drupal\Core\Site\Settings; use Symfony\Component\HttpFoundation\Request; if (PHP_SAPI !== 'cli') { return; } $autoloader = require __DIR__ . '/../../autoload.php'; require_once __DIR__ . '/../includes/bootstrap.inc'; $request = Request::createFromGlobals(); Settings::initialize(DRUPAL_ROOT, DrupalKernel::findSitePath($request), $autoloader); $timestamp = time(); $token = Crypt::hmacBase64($timestamp, Settings::get('hash_salt')); print "timestamp=$timestamp&token=$token\n";