From: Michael Wallner Date: Mon, 30 Jul 2012 18:28:12 +0000 (+0000) Subject: avoid serialization X-Git-Tag: RELEASE_2_1_0_RC3~10^2^2~123 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=ffc0b7e324486790e283b6b39353c5a9990b56f6;p=m6w6%2Fext-http avoid serialization --- diff --git a/php_http_client_datashare.c b/php_http_client_datashare.c index 2046db1..5f7a90a 100644 --- a/php_http_client_datashare.c +++ b/php_http_client_datashare.c @@ -347,9 +347,14 @@ PHP_METHOD(HttpClientDataShare, reset) RETURN_FALSE; } +PHP_METHOD(HttpClientDataShare, __sleep) +{ + php_http_error(HE_THROW, PHP_HTTP_E_CLIENT_DATASHARE, "cannot serialize a client datashare"); +} + PHP_MINIT_FUNCTION(http_client_datashare) { - PHP_HTTP_REGISTER_CLASS(http\\Client\\DataShare, AbstractDataShare, http_client_datashare, php_http_object_get_class_entry(), 0); + PHP_HTTP_REGISTER_CLASS(http\\Client\\DataShare, AbstractDataShare, http_client_datashare, php_http_object_get_class_entry(), ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); php_http_client_datashare_class_entry->create_object = php_http_client_datashare_object_new; memcpy(&php_http_client_datashare_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); php_http_client_datashare_object_handlers.clone_obj = NULL;