示例#1
0
文件: zlib.c 项目: KomaBeyond/php-src
/* {{{ php_zlib_output_conflict_check() */
static int php_zlib_output_conflict_check(const char *handler_name, size_t handler_name_len TSRMLS_DC)
{
	if (php_output_get_level(TSRMLS_C) > 0) {
		if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME) TSRMLS_CC)
		||	php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_gzhandler") TSRMLS_CC)
		||  php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler") TSRMLS_CC)
		||	php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("URL-Rewriter") TSRMLS_CC)) {
			return FAILURE;
		}
	}
	return SUCCESS;
}
示例#2
0
PHP_HTTP_API STATUS _http_start_ob_etaghandler(TSRMLS_D)
{
	/* already running? */
#ifdef PHP_OUTPUT_NEWAPI
    STATUS rv;

    if (php_output_handler_conflict(ZEND_STRL("ob_etaghandler"), ZEND_STRL("ob_etaghandler") TSRMLS_CC)) {
        return FAILURE;
    }
#else
	if (php_ob_handler_used("ob_etaghandler" TSRMLS_CC)) {
		http_error(HE_WARNING, HTTP_E_RUNTIME, "ob_etaghandler can only be used once");
		return FAILURE;
	}
#endif
	HTTP_G->etag.started = 1;
#ifdef PHP_OUTPUT_NEWAPI
    return php_output_start_internal(ZEND_STRL("ob_etaghandler"), _http_ob_etaghandler, HTTP_G->send.buffer_size, 0 TSRMLS_CC);
#else
	return php_start_ob_buffer_named("ob_etaghandler", HTTP_G->send.buffer_size, 0 TSRMLS_CC);
#endif
}