diff --git a/ext/async/channel.c b/ext/async/channel.c index 1e056ec9b..b95eb73d5 100644 --- a/ext/async/channel.c +++ b/ext/async/channel.c @@ -1487,9 +1487,12 @@ void async_channel_ce_register() async_channel_ce = zend_register_internal_class(&ce); async_channel_ce->ce_flags |= ZEND_ACC_FINAL; async_channel_ce->create_object = async_channel_object_create; +#if PHP_VERSION_ID >= 80100 + async_channel_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_channel_ce->serialize = zend_class_serialize_deny; async_channel_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_channel_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_channel_handlers.free_obj = async_channel_object_destroy; async_channel_handlers.dtor_obj = async_channel_object_dtor; @@ -1501,9 +1504,12 @@ void async_channel_ce_register() async_channel_group_ce = zend_register_internal_class(&ce); async_channel_group_ce->ce_flags |= ZEND_ACC_FINAL; async_channel_group_ce->create_object = async_channel_group_object_create; +#if PHP_VERSION_ID >= 80100 + async_channel_group_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_channel_group_ce->serialize = zend_class_serialize_deny; async_channel_group_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_channel_group_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_channel_group_handlers.free_obj = async_channel_group_object_destroy; async_channel_group_handlers.dtor_obj = async_channel_group_object_dtor; @@ -1514,8 +1520,12 @@ void async_channel_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async", "ChannelIterator", channel_iterator_functions); async_channel_iterator_ce = zend_register_internal_class(&ce); async_channel_iterator_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_channel_iterator_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_channel_iterator_ce->serialize = zend_class_serialize_deny; async_channel_iterator_ce->unserialize = zend_class_unserialize_deny; +#endif memcpy(&async_channel_iterator_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_channel_iterator_handlers.free_obj = async_channel_iterator_object_destroy; @@ -1527,9 +1537,13 @@ void async_channel_ce_register() async_channel_select_ce = zend_register_internal_class(&ce); async_channel_select_ce->ce_flags |= ZEND_ACC_FINAL; async_channel_select_ce->create_object = NULL; +#if PHP_VERSION_ID >= 80100 + async_channel_select_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_channel_select_ce->serialize = zend_class_serialize_deny; async_channel_select_ce->unserialize = zend_class_unserialize_deny; - +#endif + memcpy(&async_channel_select_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_channel_select_handlers.offset = XtOffsetOf(async_channel_select, std); async_channel_select_handlers.free_obj = async_channel_select_object_destroy; diff --git a/ext/async/console.c b/ext/async/console.c index e66960c94..5bb3a80e5 100644 --- a/ext/async/console.c +++ b/ext/async/console.c @@ -793,9 +793,13 @@ void async_console_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async\\Stream", "ReadablePipe", async_readable_pipe_functions); async_readable_pipe_ce = zend_register_internal_class(&ce); async_readable_pipe_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_readable_pipe_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_readable_pipe_ce->serialize = zend_class_serialize_deny; async_readable_pipe_ce->unserialize = zend_class_unserialize_deny; - +#endif + zend_class_implements(async_readable_pipe_ce, 1, async_readable_stream_ce); memcpy(&async_readable_pipe_handlers, &std_object_handlers, sizeof(zend_object_handlers)); @@ -806,9 +810,13 @@ void async_console_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async\\Stream", "WritablePipe", async_writable_pipe_functions); async_writable_pipe_ce = zend_register_internal_class(&ce); async_writable_pipe_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_writable_pipe_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_writable_pipe_ce->serialize = zend_class_serialize_deny; async_writable_pipe_ce->unserialize = zend_class_unserialize_deny; - +#endif + zend_class_implements(async_writable_pipe_ce, 1, async_writable_stream_ce); memcpy(&async_writable_pipe_handlers, &std_object_handlers, sizeof(zend_object_handlers)); diff --git a/ext/async/context.c b/ext/async/context.c index 51c75e4aa..d9ceac9e6 100644 --- a/ext/async/context.c +++ b/ext/async/context.c @@ -806,8 +806,12 @@ void async_context_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async", "Context", async_context_functions); async_context_ce = zend_register_internal_class(&ce); async_context_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_context_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_context_ce->serialize = zend_class_serialize_deny; async_context_ce->unserialize = zend_class_unserialize_deny; +#endif memcpy(&async_context_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_context_handlers.free_obj = async_context_object_destroy; @@ -817,9 +821,12 @@ void async_context_ce_register() async_context_var_ce = zend_register_internal_class(&ce); async_context_var_ce->ce_flags |= ZEND_ACC_FINAL; async_context_var_ce->create_object = async_context_var_object_create; +#if PHP_VERSION_ID >= 80100 + async_context_var_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_context_var_ce->serialize = zend_class_serialize_deny; async_context_var_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_context_var_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_context_var_handlers.free_obj = async_context_var_object_destroy; async_context_var_handlers.clone_obj = NULL; @@ -828,8 +835,12 @@ void async_context_ce_register() async_cancellation_handler_ce = zend_register_internal_class(&ce); async_cancellation_handler_ce->ce_flags |= ZEND_ACC_FINAL; async_cancellation_handler_ce->create_object = NULL; +#if PHP_VERSION_ID >= 80100 + async_cancellation_handler_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_cancellation_handler_ce->serialize = zend_class_serialize_deny; async_cancellation_handler_ce->unserialize = zend_class_unserialize_deny; +#endif memcpy(&async_cancellation_handler_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_cancellation_handler_handlers.free_obj = async_cancellation_handler_object_destroy; diff --git a/ext/async/deferred.c b/ext/async/deferred.c index d8778022f..6ac5a8a5d 100644 --- a/ext/async/deferred.c +++ b/ext/async/deferred.c @@ -1283,8 +1283,12 @@ void async_deferred_ce_register() async_deferred_ce = zend_register_internal_class(&ce); async_deferred_ce->ce_flags |= ZEND_ACC_FINAL; async_deferred_ce->create_object = async_deferred_object_create; +#if PHP_VERSION_ID >= 80100 + async_deferred_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_deferred_ce->serialize = zend_class_serialize_deny; async_deferred_ce->unserialize = zend_class_unserialize_deny; +#endif memcpy(&async_deferred_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_deferred_handlers.offset = XtOffsetOf(async_deferred, std); @@ -1325,8 +1329,12 @@ void async_deferred_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async", "DeferredAwaitable", deferred_awaitable_functions); async_deferred_awaitable_ce = zend_register_internal_class(&ce); async_deferred_awaitable_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_deferred_awaitable_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_deferred_awaitable_ce->serialize = zend_class_serialize_deny; async_deferred_awaitable_ce->unserialize = zend_class_unserialize_deny; +#endif memcpy(&async_deferred_awaitable_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_deferred_awaitable_handlers.offset = XtOffsetOf(async_deferred_awaitable, std); diff --git a/ext/async/dns.c b/ext/async/dns.c index f81a12ea6..0319a2d38 100644 --- a/ext/async/dns.c +++ b/ext/async/dns.c @@ -1315,8 +1315,12 @@ void async_dns_ce_register() async_dns_query_ce = zend_register_internal_class(&ce); async_dns_query_ce->ce_flags |= ZEND_ACC_FINAL; async_dns_query_ce->create_object = async_dns_query_object_create; +#if PHP_VERSION_ID >= 80100 + async_dns_query_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_dns_query_ce->serialize = zend_class_serialize_deny; async_dns_query_ce->unserialize = zend_class_unserialize_deny; +#endif memcpy(&async_dns_query_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_dns_query_handlers.offset = XtOffsetOf(async_dns_query, std); diff --git a/ext/async/event.c b/ext/async/event.c index bc0d75869..8070675eb 100644 --- a/ext/async/event.c +++ b/ext/async/event.c @@ -807,8 +807,12 @@ void async_event_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async", "PollEvent", poll_event_functions); async_poll_event_ce = zend_register_internal_class(&ce); async_poll_event_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_poll_event_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_poll_event_ce->serialize = zend_class_serialize_deny; async_poll_event_ce->unserialize = zend_class_unserialize_deny; +#endif memcpy(&async_poll_event_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_poll_event_handlers.dtor_obj = async_poll_event_object_dtor; @@ -822,8 +826,12 @@ void async_event_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async", "TickEvent", tick_event_functions); async_tick_event_ce = zend_register_internal_class(&ce); async_tick_event_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_tick_event_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_tick_event_ce->serialize = zend_class_serialize_deny; async_tick_event_ce->unserialize = zend_class_unserialize_deny; +#endif memcpy(&async_tick_event_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_tick_event_handlers.free_obj = async_tick_event_object_destroy; @@ -832,8 +840,12 @@ void async_event_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async", "TimerEvent", timer_event_functions); async_timer_event_ce = zend_register_internal_class(&ce); async_timer_event_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_timer_event_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_timer_event_ce->serialize = zend_class_serialize_deny; async_timer_event_ce->unserialize = zend_class_unserialize_deny; +#endif memcpy(&async_timer_event_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_timer_event_handlers.dtor_obj = async_timer_event_object_dtor; diff --git a/ext/async/pipe.c b/ext/async/pipe.c index 2608a1011..5563db455 100644 --- a/ext/async/pipe.c +++ b/ext/async/pipe.c @@ -1361,8 +1361,12 @@ void async_pipe_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async\\Network", "Pipe", async_pipe_functions); async_pipe_ce = zend_register_internal_class(&ce); async_pipe_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_pipe_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_pipe_ce->serialize = zend_class_serialize_deny; async_pipe_ce->unserialize = zend_class_unserialize_deny; +#endif zend_class_implements(async_pipe_ce, 1, async_socket_stream_ce); @@ -1374,9 +1378,12 @@ void async_pipe_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async\\Network", "PipeServer", async_pipe_server_functions); async_pipe_server_ce = zend_register_internal_class(&ce); async_pipe_server_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_pipe_server_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_pipe_server_ce->serialize = zend_class_serialize_deny; async_pipe_server_ce->unserialize = zend_class_unserialize_deny; - +#endif zend_class_implements(async_pipe_server_ce, 1, async_server_ce); memcpy(&async_pipe_server_handlers, &std_object_handlers, sizeof(zend_object_handlers)); diff --git a/ext/async/process/builder.c b/ext/async/process/builder.c index 8d47c5baf..e525c33b5 100644 --- a/ext/async/process/builder.c +++ b/ext/async/process/builder.c @@ -663,9 +663,12 @@ void async_process_builder_ce_register() async_process_builder_ce = zend_register_internal_class(&ce); async_process_builder_ce->ce_flags |= ZEND_ACC_FINAL; async_process_builder_ce->create_object = async_process_builder_object_create; +#if PHP_VERSION_ID >= 80100 + async_process_builder_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_process_builder_ce->serialize = zend_class_serialize_deny; async_process_builder_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_process_builder_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_process_builder_handlers.free_obj = async_process_builder_object_destroy; async_process_builder_handlers.clone_obj = NULL; diff --git a/ext/async/process/runner.c b/ext/async/process/runner.c index 4980a322a..c892a726d 100644 --- a/ext/async/process/runner.c +++ b/ext/async/process/runner.c @@ -1019,9 +1019,12 @@ void async_process_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async\\Process", "Process", async_process_functions); async_process_ce = zend_register_internal_class(&ce); async_process_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_process_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_process_ce->serialize = zend_class_serialize_deny; async_process_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_process_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_process_handlers.dtor_obj = async_process_object_dtor; async_process_handlers.free_obj = async_process_object_destroy; @@ -1031,9 +1034,12 @@ void async_process_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async\\Process", "ReadablePipe", async_readable_process_pipe_functions); async_readable_process_pipe_ce = zend_register_internal_class(&ce); async_readable_process_pipe_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_readable_process_pipe_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_readable_process_pipe_ce->serialize = zend_class_serialize_deny; async_readable_process_pipe_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_readable_process_pipe_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_readable_process_pipe_handlers.free_obj = async_readable_process_pipe_object_destroy; async_readable_process_pipe_handlers.clone_obj = NULL; @@ -1043,9 +1049,12 @@ void async_process_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async\\Process", "WritablePipe", async_writable_process_pipe_functions); async_writable_process_pipe_ce = zend_register_internal_class(&ce); async_writable_process_pipe_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_writable_process_pipe_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_writable_process_pipe_ce->serialize = zend_class_serialize_deny; async_writable_process_pipe_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_writable_process_pipe_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_writable_process_pipe_handlers.free_obj = async_writable_process_pipe_object_destroy; async_writable_process_pipe_handlers.clone_obj = NULL; diff --git a/ext/async/stream.c b/ext/async/stream.c index 1aafb8203..9eefbb47f 100644 --- a/ext/async/stream.c +++ b/ext/async/stream.c @@ -1986,9 +1986,12 @@ void async_stream_ce_register() async_readable_memory_stream_ce = zend_register_internal_class(&ce); async_readable_memory_stream_ce->ce_flags |= ZEND_ACC_FINAL; async_readable_memory_stream_ce->create_object = async_readable_memory_stream_object_create; +#if PHP_VERSION_ID >= 80100 + async_readable_memory_stream_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_readable_memory_stream_ce->serialize = zend_class_serialize_deny; async_readable_memory_stream_ce->unserialize = zend_class_unserialize_deny; - +#endif zend_class_implements(async_readable_memory_stream_ce, 1, async_readable_stream_ce); memcpy(&async_readable_memory_stream_handlers, &std_object_handlers, sizeof(zend_object_handlers)); @@ -1999,9 +2002,12 @@ void async_stream_ce_register() async_writable_memory_stream_ce = zend_register_internal_class(&ce); async_writable_memory_stream_ce->ce_flags |= ZEND_ACC_FINAL; async_writable_memory_stream_ce->create_object = async_writable_memory_stream_object_create; +#if PHP_VERSION_ID >= 80100 + async_writable_memory_stream_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_writable_memory_stream_ce->serialize = zend_class_serialize_deny; async_writable_memory_stream_ce->unserialize = zend_class_unserialize_deny; - +#endif zend_class_implements(async_writable_memory_stream_ce, 1, async_writable_stream_ce); memcpy(&async_writable_memory_stream_handlers, &std_object_handlers, sizeof(zend_object_handlers)); @@ -2011,9 +2017,12 @@ void async_stream_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async\\Stream", "StreamReader", async_stream_reader_functions); async_stream_reader_ce = zend_register_internal_class(&ce); async_stream_reader_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_stream_reader_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_stream_reader_ce->serialize = zend_class_serialize_deny; async_stream_reader_ce->unserialize = zend_class_unserialize_deny; - +#endif zend_class_implements(async_stream_reader_ce, 1, async_readable_stream_ce); memcpy(&async_stream_reader_handlers, &std_object_handlers, sizeof(zend_object_handlers)); @@ -2023,9 +2032,12 @@ void async_stream_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async\\Stream", "StreamWriter", async_stream_writer_functions); async_stream_writer_ce = zend_register_internal_class(&ce); async_stream_writer_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_stream_writer_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_stream_writer_ce->serialize = zend_class_serialize_deny; async_stream_writer_ce->unserialize = zend_class_unserialize_deny; - +#endif zend_class_implements(async_stream_writer_ce, 1, async_writable_stream_ce); memcpy(&async_stream_writer_handlers, &std_object_handlers, sizeof(zend_object_handlers)); diff --git a/ext/async/sync.c b/ext/async/sync.c index 78209705d..1c19bc352 100644 --- a/ext/async/sync.c +++ b/ext/async/sync.c @@ -263,9 +263,12 @@ void async_sync_ce_register() async_sync_condition_ce = zend_register_internal_class(&ce); async_sync_condition_ce->ce_flags |= ZEND_ACC_FINAL; async_sync_condition_ce->create_object = async_sync_condition_object_create; +#if PHP_VERSION_ID >= 80100 + async_sync_condition_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_sync_condition_ce->serialize = zend_class_serialize_deny; async_sync_condition_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_sync_condition_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_sync_condition_handlers.free_obj = async_sync_condition_object_destroy; async_sync_condition_handlers.dtor_obj = async_sync_condition_object_dtor; diff --git a/ext/async/task.c b/ext/async/task.c index 56b04f78c..029e3eb0f 100644 --- a/ext/async/task.c +++ b/ext/async/task.c @@ -2232,9 +2232,12 @@ void async_task_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async", "AwaitableImpl", empty_funcs); async_awaitable_impl_ce = zend_register_internal_class(&ce); async_awaitable_impl_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_awaitable_impl_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_awaitable_impl_ce->serialize = zend_class_serialize_deny; async_awaitable_impl_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_awaitable_impl_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_awaitable_impl_handlers.offset = XtOffsetOf(async_awaitable_impl, std); async_awaitable_impl_handlers.free_obj = async_awaitable_impl_object_destroy; @@ -2266,9 +2269,12 @@ void async_task_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async", "Task", task_functions); async_task_ce = zend_register_internal_class(&ce); async_task_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_task_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_task_ce->serialize = zend_class_serialize_deny; async_task_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_task_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_task_handlers.offset = XtOffsetOf(async_task, std); async_task_handlers.free_obj = async_task_object_destroy; @@ -2300,9 +2306,12 @@ void async_task_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async", "TaskScheduler", task_scheduler_functions); async_task_scheduler_ce = zend_register_internal_class(&ce); async_task_scheduler_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_task_scheduler_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_task_scheduler_ce->serialize = zend_class_serialize_deny; async_task_scheduler_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_task_scheduler_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_task_scheduler_handlers.free_obj = async_task_scheduler_object_destroy; async_task_scheduler_handlers.clone_obj = NULL; diff --git a/ext/async/tcp.c b/ext/async/tcp.c index 9d6d2488d..64bcf00cb 100644 --- a/ext/async/tcp.c +++ b/ext/async/tcp.c @@ -1502,9 +1502,12 @@ void async_tcp_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async\\Network", "TcpSocket", async_tcp_socket_functions); async_tcp_socket_ce = zend_register_internal_class(&ce); async_tcp_socket_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_tcp_socket_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_tcp_socket_ce->serialize = zend_class_serialize_deny; async_tcp_socket_ce->unserialize = zend_class_unserialize_deny; - +#endif zend_class_implements(async_tcp_socket_ce, 1, async_socket_stream_ce); memcpy(&async_tcp_socket_handlers, &std_object_handlers, sizeof(zend_object_handlers)); @@ -1518,9 +1521,12 @@ void async_tcp_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async\\Network", "TcpServer", async_tcp_server_functions); async_tcp_server_ce = zend_register_internal_class(&ce); async_tcp_server_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_tcp_server_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_tcp_server_ce->serialize = zend_class_serialize_deny; async_tcp_server_ce->unserialize = zend_class_unserialize_deny; - +#endif zend_class_implements(async_tcp_server_ce, 1, async_server_ce); memcpy(&async_tcp_server_handlers, &std_object_handlers, sizeof(zend_object_handlers)); diff --git a/ext/async/thread.c b/ext/async/thread.c index 8b2c620d9..417a1f950 100644 --- a/ext/async/thread.c +++ b/ext/async/thread.c @@ -745,9 +745,12 @@ void async_thread_ce_register() async_thread_ce = zend_register_internal_class(&ce); async_thread_ce->ce_flags |= ZEND_ACC_FINAL; async_thread_ce->create_object = async_thread_object_create; +#if PHP_VERSION_ID >= 80100 + async_thread_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_thread_ce->serialize = zend_class_serialize_deny; async_thread_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_thread_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_thread_handlers.free_obj = async_thread_object_destroy; async_thread_handlers.dtor_obj = async_thread_object_dtor; diff --git a/ext/async/udp.c b/ext/async/udp.c index caf1030c4..12de88472 100644 --- a/ext/async/udp.c +++ b/ext/async/udp.c @@ -1138,9 +1138,12 @@ void async_udp_socket_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async\\Network", "UdpSocket", async_udp_socket_functions); async_udp_socket_ce = zend_register_internal_class(&ce); async_udp_socket_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_udp_socket_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_udp_socket_ce->serialize = zend_class_serialize_deny; async_udp_socket_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_udp_socket_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_udp_socket_handlers.free_obj = async_udp_socket_object_destroy; async_udp_socket_handlers.dtor_obj = async_udp_socket_object_dtor; @@ -1156,9 +1159,12 @@ void async_udp_socket_ce_register() async_udp_datagram_ce = zend_register_internal_class(&ce); async_udp_datagram_ce->ce_flags |= ZEND_ACC_FINAL; async_udp_datagram_ce->create_object = async_udp_datagram_object_create; +#if PHP_VERSION_ID >= 80100 + async_udp_datagram_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_udp_datagram_ce->serialize = zend_class_serialize_deny; async_udp_datagram_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_udp_datagram_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_udp_datagram_handlers.offset = XtOffsetOf(async_udp_datagram, std); async_udp_datagram_handlers.free_obj = async_udp_datagram_object_destroy; diff --git a/ext/async/watcher/monitor.c b/ext/async/watcher/monitor.c index 740e24739..d28964721 100644 --- a/ext/async/watcher/monitor.c +++ b/ext/async/watcher/monitor.c @@ -356,9 +356,12 @@ void async_monitor_ce_register() async_monitor_ce = zend_register_internal_class(&ce); async_monitor_ce->ce_flags |= ZEND_ACC_FINAL; async_monitor_ce->create_object = async_monitor_object_create; +#if PHP_VERSION_ID >= 80100 + async_monitor_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_monitor_ce->serialize = zend_class_serialize_deny; async_monitor_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_monitor_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_monitor_handlers.free_obj = async_monitor_object_destroy; async_monitor_handlers.dtor_obj = async_monitor_object_dtor; @@ -368,9 +371,12 @@ void async_monitor_ce_register() async_monitor_event_ce = zend_register_internal_class(&ce); async_monitor_event_ce->ce_flags |= ZEND_ACC_FINAL; async_monitor_event_ce->create_object = NULL; +#if PHP_VERSION_ID >= 80100 + async_monitor_event_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_monitor_event_ce->serialize = zend_class_serialize_deny; async_monitor_event_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_monitor_event_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_monitor_event_handlers.offset = XtOffsetOf(async_monitor_event, std); async_monitor_event_handlers.free_obj = async_monitor_event_object_destroy; diff --git a/ext/async/watcher/poll.c b/ext/async/watcher/poll.c index be8a6580b..8e7bb6a44 100644 --- a/ext/async/watcher/poll.c +++ b/ext/async/watcher/poll.c @@ -398,9 +398,12 @@ void async_poll_ce_register() async_poll_ce = zend_register_internal_class(&ce); async_poll_ce->ce_flags |= ZEND_ACC_FINAL; async_poll_ce->create_object = async_poll_object_create; +#if PHP_VERSION_ID >= 80100 + async_poll_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_poll_ce->serialize = zend_class_serialize_deny; async_poll_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_poll_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_poll_handlers.free_obj = async_poll_object_destroy; async_poll_handlers.dtor_obj = async_poll_object_dtor; diff --git a/ext/async/watcher/signal.c b/ext/async/watcher/signal.c index 7c2dee285..3e3b525a5 100644 --- a/ext/async/watcher/signal.c +++ b/ext/async/watcher/signal.c @@ -382,9 +382,12 @@ void async_signal_ce_register() async_signal_ce = zend_register_internal_class(&ce); async_signal_ce->ce_flags |= ZEND_ACC_FINAL; async_signal_ce->create_object = async_signal_object_create; +#if PHP_VERSION_ID >= 80100 + async_signal_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_signal_ce->serialize = zend_class_serialize_deny; async_signal_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_signal_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_signal_handlers.free_obj = async_signal_object_destroy; async_signal_handlers.dtor_obj = async_signal_object_dtor; diff --git a/ext/async/watcher/timer.c b/ext/async/watcher/timer.c index 1632198c4..e21542dcc 100644 --- a/ext/async/watcher/timer.c +++ b/ext/async/watcher/timer.c @@ -564,8 +564,12 @@ void async_timer_ce_register() async_timer_ce = zend_register_internal_class(&ce); async_timer_ce->ce_flags |= ZEND_ACC_FINAL; async_timer_ce->create_object = async_timer_object_create; +#if PHP_VERSION_ID >= 80100 + async_timer_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_timer_ce->serialize = zend_class_serialize_deny; async_timer_ce->unserialize = zend_class_unserialize_deny; +#endif memcpy(&async_timer_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_timer_handlers.free_obj = async_timer_object_destroy; @@ -575,9 +579,12 @@ void async_timer_ce_register() INIT_NS_CLASS_ENTRY(ce, "Phalcon\\Async", "Timeout", async_timeout_functions); async_timeout_ce = zend_register_internal_class(&ce); async_timeout_ce->ce_flags |= ZEND_ACC_FINAL; +#if PHP_VERSION_ID >= 80100 + async_timeout_ce->ce_flags |= ZEND_ACC_NOT_SERIALIZABLE; +#else async_timeout_ce->serialize = zend_class_serialize_deny; async_timeout_ce->unserialize = zend_class_unserialize_deny; - +#endif memcpy(&async_timeout_handlers, &std_object_handlers, sizeof(zend_object_handlers)); async_timeout_handlers.free_obj = async_timeout_object_destroy; async_timeout_handlers.dtor_obj = async_timeout_object_dtor; diff --git a/ext/files.c b/ext/files.c index 877de8f62..df3ab2f95 100644 --- a/ext/files.c +++ b/ext/files.c @@ -295,7 +295,7 @@ PHPAPI int php_copy_file_ctx(const char *src, const char *dest, int src_flg, php return FAILURE; } - switch (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET | PHP_STREAM_URL_STAT_NOCACHE, &dest_s, ctx)) { + switch (php_stream_stat_path_ex(dest, PHP_STREAM_URL_STAT_QUIET, &dest_s, ctx)) { case -1: /* non-statable stream */ goto safe_to_copy; @@ -474,9 +474,15 @@ int rmtree_iterator(zend_object_iterator *iter, void *puser) case SPL_FS_DIR: case SPL_FS_FILE: case SPL_FS_INFO: +#if PHP_VERSION_ID >= 80100 + php_stat(intern->file_name, FS_IS_DIR, &dummy); + is_dir = zend_is_true(&dummy); + fname = expand_filepath(ZSTR_VAL(intern->file_name), NULL); +#else php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, &dummy); is_dir = zend_is_true(&dummy); fname = expand_filepath(intern->file_name, NULL); +#endif if (!fname) { zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Could not resolve file path"); return ZEND_HASH_APPLY_STOP; @@ -608,7 +614,11 @@ int list_iterator(zend_object_iterator *iter, void *puser) { zval filename = {}; spl_filesystem_object *intern = (spl_filesystem_object*)spl_filesystem_from_obj(Z_OBJ_P(value)); +#if PHP_VERSION_ID >= 80100 + ZVAL_STR(&filename, intern->file_name); +#else ZVAL_STRINGL(&filename, intern->file_name, intern->file_name_len); +#endif phalcon_array_append(return_value, &filename, 0); break; } @@ -644,11 +654,19 @@ int list_file_iterator(zend_object_iterator *iter, void *puser) case SPL_FS_DIR: case SPL_FS_FILE: case SPL_FS_INFO: +#if PHP_VERSION_ID >= 80100 + php_stat(intern->file_name, FS_IS_FILE, &dummy); + if (zend_is_true(&dummy)) { + ZVAL_STR(&filename, intern->file_name); + phalcon_array_append(return_value, &filename, 0); + } +#else php_stat(intern->file_name, intern->file_name_len, FS_IS_FILE, &dummy); if (zend_is_true(&dummy)) { ZVAL_STRINGL(&filename, intern->file_name, intern->file_name_len); phalcon_array_append(return_value, &filename, 0); } +#endif break; default: break; @@ -686,9 +704,17 @@ int list_dir_iterator(zend_object_iterator *iter, void *puser) case SPL_FS_DIR: case SPL_FS_FILE: case SPL_FS_INFO: +#if PHP_VERSION_ID >= 80100 + php_stat(intern->file_name, FS_IS_DIR, &dummy); +#else php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, &dummy); +#endif if (zend_is_true(&dummy)) { +#if PHP_VERSION_ID >= 80100 + ZVAL_STR(&filename, intern->file_name); +#else ZVAL_STRINGL(&filename, intern->file_name, intern->file_name_len); +#endif phalcon_array_append(return_value, &filename, 0); } break; diff --git a/ext/kernel/file.c b/ext/kernel/file.c index 2214321b4..ca2f356f3 100644 --- a/ext/kernel/file.c +++ b/ext/kernel/file.c @@ -45,6 +45,7 @@ int phalcon_file_exists_str(char *filename){ return FAILURE; } #if PHP_VERSION_ID >= 80100 + zend_string *new_str; new_str = zend_string_init(filename, strlen(filename), 0); php_stat(new_str, FS_EXISTS, &exists_flag); zend_string_release(new_str); @@ -82,6 +83,7 @@ int phalcon_is_file_str(char *filename) zval tmp = {}; int ret; #if PHP_VERSION_ID >= 80100 + zend_string *new_str; new_str = zend_string_init(filename, strlen(filename), 0); php_stat(new_str, FS_EXISTS, &tmp); zend_string_release(new_str); @@ -540,6 +542,7 @@ int phalcon_is_dir_str(char *path) zval tmp = {}; int ret; #if PHP_VERSION_ID >= 80100 + zend_string *new_str; new_str = zend_string_init(path, strlen(path), 0); php_stat(new_str, FS_IS_DIR, &tmp); zend_string_release(new_str); diff --git a/ext/kernel/memory.h b/ext/kernel/memory.h index ba37213ad..64c16178e 100644 --- a/ext/kernel/memory.h +++ b/ext/kernel/memory.h @@ -110,7 +110,15 @@ int phalcon_del_symbol_str(zend_array *symbol_table, char *key_name, unsigned in #define PHALCON_SEPARATE_PARAM(z) \ do { \ ZVAL_DEREF(z); \ - SEPARATE_ZVAL_IF_NOT_REF(z); \ + zval *__zv = (z); \ + if (Z_TYPE_P(__zv) == IS_ARRAY) { \ + if (Z_REFCOUNT_P(__zv) > 1) { \ + if (Z_REFCOUNTED_P(__zv)) { \ + Z_DELREF_P(__zv); \ + } \ + ZVAL_ARR(__zv, zend_array_dup(Z_ARR_P(__zv)));\ + } \ + } \ } while (0) #define PHALCON_COPY_TO_STACK(a, b) \