Skip to content

Commit

Permalink
Add version into phpinfo() (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeriyoshi authored Sep 13, 2024
1 parent 98d6c5f commit 665be56
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions ext/colopl_bc.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ PHP_MINFO_FUNCTION(colopl_bc)
{
php_info_print_table_start();
php_info_print_table_header(2, "colopl_bc support", "enabled");
php_info_print_table_row(2, "bc version", PHP_COLOPL_BC_VERSION);
php_info_print_table_end();
}

Expand Down
17 changes: 17 additions & 0 deletions ext/tests/phpinfo.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--TEST--
Check phpinfo()
--EXTENSIONS--
colopl_bc
--FILE--
<?php
ob_start(
static fn (string $phpinfo): string
=> str_contains($phpinfo, 'colopl_bc support')
? ('Success: ' . \phpversion('colopl_bc'))
: 'Failure'
);
phpinfo();
ob_end_flush();
?>
--EXPECTF--
Success: %s

0 comments on commit 665be56

Please sign in to comment.