diff --git a/agents-api.php b/agents-api.php index 95be7e1..aebec6f 100644 --- a/agents-api.php +++ b/agents-api.php @@ -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 ) { diff --git a/tests/bootstrap-version-skew-smoke.php b/tests/bootstrap-version-skew-smoke.php index 37a2607..1cad6de 100644 --- a/tests/bootstrap-version-skew-smoke.php +++ b/tests/bootstrap-version-skew-smoke.php @@ -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", '', @@ -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";