2013-12-10 13:50:21 +00:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Command line token calculator for rebuild.php.
|
|
|
|
*/
|
|
|
|
|
|
|
|
use Drupal\Component\Utility\Crypt;
|
2014-06-26 10:47:01 +00:00
|
|
|
use Drupal\Core\DrupalKernel;
|
2014-04-25 19:13:44 +00:00
|
|
|
use Drupal\Core\Site\Settings;
|
2014-06-26 10:47:01 +00:00
|
|
|
use Symfony\Component\HttpFoundation\Request;
|
2013-12-10 13:50:21 +00:00
|
|
|
|
2014-08-13 23:44:31 +00:00
|
|
|
if (PHP_SAPI !== 'cli') {
|
2014-05-05 01:14:23 +00:00
|
|
|
return;
|
2013-12-10 13:50:21 +00:00
|
|
|
}
|
|
|
|
|
2014-06-26 10:47:01 +00:00
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
|
|
require_once __DIR__ . '/../includes/bootstrap.inc';
|
2014-05-05 01:14:23 +00:00
|
|
|
|
2014-06-26 10:47:01 +00:00
|
|
|
$request = Request::createFromGlobals();
|
|
|
|
Settings::initialize(DrupalKernel::findSitePath($request));
|
2014-05-05 01:14:23 +00:00
|
|
|
|
2013-12-10 13:50:21 +00:00
|
|
|
$timestamp = time();
|
2014-03-24 08:51:28 +00:00
|
|
|
$token = Crypt::hmacBase64($timestamp, Settings::get('hash_salt'));
|
2013-12-10 13:50:21 +00:00
|
|
|
|
|
|
|
print "timestamp=$timestamp&token=$token\n";
|