Skip to content

Commit

Permalink
Do not use GIT or PHP prefixes for debug token calculation. They tend…
Browse files Browse the repository at this point in the history
… to differ between web and shell.
  • Loading branch information
ragnarkurmwunder committed May 9, 2022
1 parent b186b4a commit d49ee1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _ping.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public function getToken(array $settings): string {
$env = getenv();
ksort($env);
foreach ($env as $key => $value) {
if (preg_match('/^(DB|ENVIRONMENT_NAME|GIT|PHP|PROJECT_NAME|S+MTP|VARNISH|WARDEN)/', $key)) {
if (preg_match('/^(DB|ENVIRONMENT_NAME|PROJECT_NAME|S+MTP|VARNISH|WARDEN)/', $key)) {
$token[] = $value;
}
}
Expand Down
7 changes: 3 additions & 4 deletions tests/AppTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static function setUpBeforeClass(): void {
protected function setUp(): void {
// Cleanup env before every test
foreach (getenv() as $key => $value) {
if (preg_match('/^(DB|ENVIRONMENT_NAME|GIT|PHP|PROJECT_NAME|S+MTP|VARNISH|WARDEN)/', $key)) {
if (preg_match('/^(DB|ENVIRONMENT_NAME|PROJECT_NAME|S+MTP|VARNISH|WARDEN)/', $key)) {
putenv($key);
}
}
Expand Down Expand Up @@ -123,8 +123,6 @@ public function testGetTokenEnv(): void {
foreach ([
'DB_NAME',
'ENVIRONMENT_NAME',
'GIT_TEST',
'PHP_TEST',
'PROJECT_NAME',
'SMTP',
'SSMTP',
Expand All @@ -135,7 +133,8 @@ public function testGetTokenEnv(): void {
}
$settings = [];
$data = $a->getToken($settings);
$this->assertEquals('7c3df2116154d33f51c6d77db9aa3dbc', $data);
$expected = '4a0270283e75b2582fb73459df6f488e';
$this->assertEquals($expected, $data);
}

/**
Expand Down

0 comments on commit d49ee1c

Please sign in to comment.