summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
Diffstat (limited to 'sapi')
-rw-r--r--sapi/apache2handler/sapi_apache2.c6
-rw-r--r--sapi/cgi/cgi_main.c6
-rw-r--r--sapi/cli/php_cli_server.c12
-rw-r--r--sapi/litespeed/lsapi_main.c6
4 files changed, 5 insertions, 25 deletions
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index 193420eca4..1cc5670eaa 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -694,11 +694,7 @@ zend_first_try {
highlight_file((char *)r->filename, &syntax_highlighter_ini);
} else {
zend_file_handle zfd;
-
- zfd.type = ZEND_HANDLE_FILENAME;
- zfd.filename = (char *) r->filename;
- zfd.free_filename = 0;
- zfd.opened_path = NULL;
+ zend_stream_init_filename(&zfd, (char *) r->filename);
if (!parent_req) {
php_execute_script(&zfd);
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 1068930c39..81de65351f 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -2476,11 +2476,7 @@ parent_loop_end:
we need in the environment.
*/
if (SG(request_info).path_translated || cgi || fastcgi) {
- file_handle.type = ZEND_HANDLE_FILENAME;
- file_handle.filename = SG(request_info).path_translated;
- file_handle.handle.fp = NULL;
- file_handle.opened_path = NULL;
- file_handle.free_filename = 0;
+ zend_stream_init_filename(&file_handle, SG(request_info).path_translated);
} else {
zend_stream_init_fp(&file_handle, stdin, "Standard input code");
}
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 40fad8c10b..f00d8dee54 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -2072,11 +2072,7 @@ static int php_cli_server_dispatch_script(php_cli_server *server, php_cli_server
}
{
zend_file_handle zfd;
- zfd.type = ZEND_HANDLE_FILENAME;
- zfd.filename = SG(request_info).path_translated;
- zfd.handle.fp = NULL;
- zfd.free_filename = 0;
- zfd.opened_path = NULL;
+ zend_stream_init_filename(&zfd, SG(request_info).path_translated);
zend_try {
php_execute_script(&zfd);
} zend_end_try();
@@ -2197,11 +2193,7 @@ static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server
old_cwd[0] = '\0';
php_ignore_value(VCWD_GETCWD(old_cwd, MAXPATHLEN - 1));
- zfd.type = ZEND_HANDLE_FILENAME;
- zfd.filename = server->router;
- zfd.handle.fp = NULL;
- zfd.free_filename = 0;
- zfd.opened_path = NULL;
+ zend_stream_init_filename(&zfd, server->router);
zend_try {
zval retval;
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index bec0eacb81..baff98df1e 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -657,11 +657,7 @@ static int lsapi_execute_script( zend_file_handle * file_handle)
{
char *p;
int len;
- file_handle->type = ZEND_HANDLE_FILENAME;
- file_handle->handle.fd = 0;
- file_handle->filename = SG(request_info).path_translated;
- file_handle->free_filename = 0;
- file_handle->opened_path = NULL;
+ zend_stream_init_filename(file_handle, SG(request_info).path_translated);
p = argv0;
*p++ = ':';