avoid serialization
authorMichael Wallner <mike@php.net>
Mon, 30 Jul 2012 18:28:12 +0000 (18:28 +0000)
committerMichael Wallner <mike@php.net>
Mon, 30 Jul 2012 18:28:12 +0000 (18:28 +0000)
php_http_client_datashare.c

index 2046db104957efda7a6a1b115ae3c03b0467aec7..5f7a90a26ab13406fd511b0256b85587fabec4d5 100644 (file)
@@ -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;