Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion agents-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
};

$agents_api_symbol_files = array_merge(
glob( __DIR__ . '/src/*/{class,interface}-*.php', GLOB_BRACE ) ?: array(),
glob( __DIR__ . '/src/*/class-*.php' ) ?: array(),
glob( __DIR__ . '/src/*/interface-*.php' ) ?: array(),
array( __DIR__ . '/src/Channels/register-default-agents-chat-handler.php' )
);
foreach ( $agents_api_symbol_files as $agents_api_symbol_file ) {
Expand Down
7 changes: 6 additions & 1 deletion tests/bootstrap-version-skew-smoke.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ function agents_api_copy_directory( string $source, string $destination ): void

agents_api_copy_directory( $root . '/src', $old_copy . '/src' );
$old_bootstrap = (string) file_get_contents( $root . '/agents-api.php' );
if ( str_contains( $old_bootstrap, 'GLOB_BRACE' ) ) {
fwrite( STDERR, "FAIL: bootstrap discovery depends on the optional GLOB_BRACE flag.\n" );
exit( 1 );
}

$old_bootstrap = str_replace(
"require_once AGENTS_API_PATH . 'src/Channels/class-wp-agent-channel.php';\n",
'',
Expand Down Expand Up @@ -59,4 +64,4 @@ function agents_api_copy_directory( string $source, string $destination ): void
exit( 1 );
}

echo "PASS: newer copy tops up missing classes without repeating hooks.\n";
echo "PASS: portable discovery tops up missing classes without repeating hooks.\n";