Skip to content

Commit f746fdc

Browse files
Ensure internal composer class only included once (#188)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent ee14595 commit f746fdc

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

agent/build/agent.phar

68 Bytes
Binary file not shown.

agent/build/signature.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
299B3E43194D1C173D8D265762BA9877B3E94D18B3D4133A4B48F056AFC6601497AB0BA6616897D0BCECFCFD2C46402107FB6A1F7B476F898ADF424770A874BE
1+
8A4301888EACC36E69F54C56E76BDFDB93BC1A35A7CC9A68204718A0A88FF903F23525344E096093FC54DDBDEB8763840CAE40886618304C3B50A51E82664ECD

agent/scoper.inc.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,14 @@
22

33
return [
44
'prefix' => 'NightwatchAgent_kden27khxA4QoEfj',
5+
'patchers' => [
6+
// There are situations when this file is manually required twice by Box causing a fatal PHP error.
7+
static function (string $filePath, string $prefix, string $content): string {
8+
if ($filePath === 'vendor/composer/InstalledVersions.php') {
9+
$content = str_replace('class InstalledVersions', "\nif (! class_exists(InstalledVersions::class, autoload: false)) {\nclass InstalledVersions", $content).'}'.PHP_EOL;
10+
}
11+
12+
return $content;
13+
},
14+
],
515
];

src/Payload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class Payload
1717
*
1818
* Do not modify or re-locate this constant.
1919
*/
20-
public const SIGNATURE = '299B3E4';
20+
public const SIGNATURE = '8A43018';
2121

2222
private bool $pulled = false;
2323

0 commit comments

Comments
 (0)