Re: GD as shared extension
| From: | Andrei Zmievski | Date: | Fri, 22 Jun 2007 16:25:11 +0000 |
| Subject: | Re: GD as shared extension | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-3904@lists.php.net to get a copy of this message | ||
What would be ideal is to have new_from_gd() work only if GD is loaded and simply output an error message if it's not. But I'm not sure if that is possible..
-Andrei
On Jun 22, 2007, at 9:13 AM, Elizabeth Smith wrote:
I've been doing some work on getting GdkPixbuf::new_from_gd working with a shared gd as well as a static gd. The attached patch contains the C portion of the fixes required for forcing gd to load before php-gtk2 - however, it will require some build fixes to work properly - which I am still messing with. Index: ext/gtk+/gdk.overrides =================================================================== RCS file: /repository/php-gtk/ext/gtk+/gdk.overrides,v retrieving revision 1.76 diff -u -r1.76 gdk.overrides --- ext/gtk+/gdk.overrides 15 Jun 2007 21:06:31 -0000 1.76 +++ ext/gtk+/gdk.overrides 22 Jun 2007 13:39:57 -0000 @@ -1851,7 +1851,7 @@ %% add GdkPixbuf new_from_gd ZEND_ACC_PUBLIC|ZEND_ACC_STATIC -#if HAVE_GD_BUNDLED +#if HAVE_GD #include "ext/gd/php_gd.h" #include "ext/gd/libgd/gd.h" #endif @@ -1863,7 +1863,7 @@ PHP_METHOD { -#if HAVE_GD_BUNDLED +#if HAVE_GDzval *php_gd; gdImagePtr gd; guint *data;@@ -1941,7 +1941,7 @@phpg_gobject_new(&return_value, (GObject *)pixbuf TSRMLS_CC); g_object_unref(pixbuf); /* phpg_gobject_new() increments reference count */#else- php_error(E_ERROR, "PHP-GTK was not compiled against PHP with bundled GD library"); + php_error(E_ERROR, "PHP-GTK was not compiled with GD support");#endif } Index: main/php_gtk.c =================================================================== RCS file: /repository/php-gtk/main/php_gtk.c,v retrieving revision 1.56 diff -u -r1.56 php_gtk.c --- main/php_gtk.c 9 Sep 2006 17:58:57 -0000 1.56 +++ main/php_gtk.c 22 Jun 2007 13:38:26 -0000 @@ -41,6 +41,16 @@ PHP_GTK_API GHashTable *php_gtk_class_hash = NULL; PHP_GTK_API zend_object_handlers php_gtk_handlers; +/* {{{ php-gtk_deps + */ +#if ZEND_MODULE_API_NO >= 20050922 && HAVE_GD +static zend_module_dep php_gtk_deps[] = { + ZEND_MOD_REQUIRED("gd") + {NULL, NULL, NULL} +}; +#endif +/* }}} */ + const gchar *phpg_class_id = "phpg_class"; GQuark phpg_class_key = 0; GType G_TYPE_PHP_VALUE = 0; @@ -48,7 +58,12 @@ ZEND_DECLARE_MODULE_GLOBALS(gtk); zend_module_entry gtk_module_entry = { +#if ZEND_MODULE_API_NO >= 20050922 && HAVE_GD + STANDARD_MODULE_HEADER_EX, NULL, + php_gtk_deps, +#else STANDARD_MODULE_HEADER, +#endif "php-gtk", NULL, PHP_MINIT(gtk), --PHP-GTK Development Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php