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-04-25 19:13:44 +00:00
|
|
|
use Drupal\Core\Site\Settings;
|
2013-12-10 13:50:21 +00:00
|
|
|
|
2014-05-05 01:14:23 +00:00
|
|
|
// Check for $_SERVER['argv'] instead of PHP_SAPI === 'cli' to allow this script
|
|
|
|
// to be tested with the Simpletest UI test runner.
|
|
|
|
// @see \Drupal\system\Tests\System\ScriptTest
|
|
|
|
if (!isset($_SERVER['argv']) || !is_array($_SERVER['argv'])) {
|
|
|
|
return;
|
2013-12-10 13:50:21 +00:00
|
|
|
}
|
|
|
|
|
2014-06-05 17:53:24 +00:00
|
|
|
$core = dirname(__DIR__);
|
|
|
|
require_once $core . '/vendor/autoload.php';
|
|
|
|
require_once $core . '/includes/bootstrap.inc';
|
2014-05-05 01:14:23 +00:00
|
|
|
|
2014-06-05 17:53:24 +00:00
|
|
|
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
|
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";
|