Skip to content

Commit

Permalink
add version to phpinfo (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeriyoshi authored Sep 13, 2024
1 parent 65a2b56 commit 8bea83f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions ext/colopl_timeshifter.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ PHP_MINFO_FUNCTION(colopl_timeshifter)
{
php_info_print_table_start();
php_info_print_table_header(2, "colopl_timeshifter support", "enabled");
php_info_print_table_row(2, "timeshifter version", PHP_COLOPL_TIMESHIFTER_VERSION);
php_info_print_table_end();
}

Expand Down
2 changes: 1 addition & 1 deletion ext/php_colopl_timeshifter.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bool get_is_hooked();
extern zend_module_entry colopl_timeshifter_module_entry;
# define phpext_colopl_timeshifter_ptr &colopl_timeshifter_module_entry

# define PHP_COLOPL_TIMESHIFTER_VERSION "1.1.1"
# define PHP_COLOPL_TIMESHIFTER_VERSION "1.1.2dev"

ZEND_BEGIN_MODULE_GLOBALS(colopl_timeshifter)
struct pdo_dbh_methods hooked_mysql_driver_methods;
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_timeshifter
--FILE--
<?php
ob_start(
static fn (string $phpinfo): string
=> str_contains($phpinfo, 'colopl_timeshifter support')
? ('Success: ' . \phpversion('colopl_timeshifter'))
: 'Failure'
);
phpinfo();
ob_end_flush();
?>
--EXPECTF--
Success: %d.%d.%d%s

0 comments on commit 8bea83f

Please sign in to comment.