Change Zend Stream API to use zend_string* instead of char*.

This allows to eliminate re-calculation of string lenght and hash value.
See the detailed list of changes in UPGRADING.INTERNALS.
This commit is contained in:
Dmitry Stogov 2021-03-16 20:31:36 +03:00
parent 9bbeb0555b
commit c732ab400a
45 changed files with 441 additions and 404 deletions

View file

@ -2015,9 +2015,11 @@ static int php_cli_server_dispatch_script(php_cli_server *server, php_cli_server
{
zend_file_handle zfd;
zend_stream_init_filename(&zfd, SG(request_info).path_translated);
zfd.primary_script = 1;
zend_try {
php_execute_script(&zfd);
} zend_end_try();
zend_destroy_file_handle(&zfd);
}
php_cli_server_log_response(client, SG(sapi_headers).http_response_code, NULL);
@ -2136,6 +2138,7 @@ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server
php_ignore_value(VCWD_GETCWD(old_cwd, MAXPATHLEN - 1));
zend_stream_init_filename(&zfd, server->router);
zfd.primary_script = 1;
zend_try {
zval retval;
@ -2149,6 +2152,8 @@ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server
}
} zend_end_try();
zend_destroy_file_handle(&zfd);
if (old_cwd[0] != '\0') {
php_ignore_value(VCWD_CHDIR(old_cwd));
}