From b333a3986af6b1a89d45a76696cc48b3e3e88fc0 Mon Sep 17 00:00:00 2001 From: Brad Erickson Date: Mon, 17 Nov 2014 19:26:51 -0800 Subject: [PATCH] Add version check for info logos to support PHP 5.5: https://bugs.php.net/bug.php?id=65356 --- pdo_4d.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pdo_4d.c b/pdo_4d.c index 47a780c..a9ebe0d 100644 --- a/pdo_4d.c +++ b/pdo_4d.c @@ -41,7 +41,9 @@ /* {{{ phpinfo logo definitions */ -#include "php_logos.h" +#if PHP_VERSION_ID < 50500 + #include "php_logos.h" +#endif static unsigned char pdo_4d_logo[] = { @@ -87,10 +89,13 @@ PHP_INI_END() /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(pdo_4d) { - php_register_info_logo("PDO_4D_LOGO_ID", "", pdo_4d_logo, 778); + #if PHP_VERSION_ID < 50500 + /* register the logo */ + php_register_info_logo("PDO_4D_LOGO_ID", "", pdo_4d_logo, 778); + #endif REGISTER_INI_ENTRIES(); /* add your stuff here */ - + /* register 4d pdo driver */ if (FAILURE == php_pdo_register_driver(&pdo_4d_driver)) { /* fprintf(stderr,"Error on register pdo-4d driver\n"); */ @@ -108,8 +113,10 @@ PHP_MINIT_FUNCTION(pdo_4d) /* {{{ PHP_MSHUTDOWN_FUNCTION */ PHP_MSHUTDOWN_FUNCTION(pdo_4d) { - php_unregister_info_logo("PDO_4D_LOGO_ID"); - + #if PHP_VERSION_ID < 50500 + php_unregister_info_logo("PDO_4D_LOGO_ID"); + #endif + php_pdo_unregister_driver(&pdo_4d_driver); UNREGISTER_INI_ENTRIES();