ZEND_API void (*zend_ticks_function)(int ticks);
ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
+void (*zend_on_timeout)(int seconds TSRMLS_DC);
+
static void (*zend_message_dispatcher_p)(long message, void *data);
static int (*zend_get_configuration_directive_p)(char *name, uint name_length, zval *contents);
zend_unblock_interruptions = utility_functions->unblock_interruptions;
zend_get_configuration_directive_p = utility_functions->get_configuration_directive;
zend_ticks_function = utility_functions->ticks_function;
+ zend_on_timeout = utility_functions->on_timeout;
zend_compile_file = compile_file;
zend_execute = execute;
void (*unblock_interruptions)(void);
int (*get_configuration_directive)(char *name, uint name_length, zval *contents);
void (*ticks_function)(int ticks);
+ void (*on_timeout)(int seconds TSRMLS_DC);
} zend_utility_functions;
extern ZEND_API void (*zend_unblock_interruptions)(void);
extern ZEND_API void (*zend_ticks_function)(int ticks);
extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
+extern void (*zend_on_timeout)(int seconds TSRMLS_DC);
ZEND_API void zend_error(int type, const char *format, ...);
{
TSRMLS_FETCH();
- /* is there any point in this? we're terminating the request anyway...
- PG(connection_status) |= PHP_CONNECTION_TIMEOUT;
- */
zend_error(E_ERROR, "Maximum execution time of %d second%s exceeded",
EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s");
+ if (zend_on_timeout) {
+ zend_on_timeout(EG(timeout_seconds) TSRMLS_CC);
+ }
}