Skip to content

Commit 6568f29

Browse files
Fix some manually registered constants
1 parent 6193b67 commit 6568f29

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

ext/com_dotnet/com_typeinfo.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ PHP_COM_DOTNET_API zend_result php_com_import_typelib(ITypeLib *TL, int mode, in
233233
} else {
234234
c.name = const_name;
235235
}
236+
zend_string *filename = zend_get_executed_filename_ex();
237+
if (filename == NULL) {
238+
c.filename = NULL;
239+
} else {
240+
c.filename = zend_string_copy(filename);
241+
}
236242
zend_register_constant(&c);
237243
}
238244
ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);

sapi/cli/php_cli.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,14 +546,17 @@ static void cli_register_file_handles(void)
546546

547547
Z_CONSTANT_FLAGS(ic.value) = 0;
548548
ic.name = zend_string_init_interned("STDIN", sizeof("STDIN")-1, 0);
549+
ic.filename = NULL;
549550
zend_register_constant(&ic);
550551

551552
Z_CONSTANT_FLAGS(oc.value) = 0;
552553
oc.name = zend_string_init_interned("STDOUT", sizeof("STDOUT")-1, 0);
554+
oc.filename = NULL;
553555
zend_register_constant(&oc);
554556

555557
Z_CONSTANT_FLAGS(ec.value) = 0;
556558
ec.name = zend_string_init_interned("STDERR", sizeof("STDERR")-1, 0);
559+
ec.filename = NULL;
557560
zend_register_constant(&ec);
558561
}
559562

sapi/phpdbg/phpdbg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,18 +914,21 @@ void phpdbg_register_file_handles(void) /* {{{ */
914914
ic.value = zin;
915915
Z_CONSTANT_FLAGS(ic.value) = 0;
916916
ic.name = zend_string_init(ZEND_STRL("STDIN"), 0);
917+
ic.filename = NULL;
917918
zend_hash_del(EG(zend_constants), ic.name);
918919
zend_register_constant(&ic);
919920

920921
oc.value = zout;
921922
Z_CONSTANT_FLAGS(oc.value) = 0;
922923
oc.name = zend_string_init(ZEND_STRL("STDOUT"), 0);
924+
oc.filename = NULL;
923925
zend_hash_del(EG(zend_constants), oc.name);
924926
zend_register_constant(&oc);
925927

926928
ec.value = zerr;
927929
Z_CONSTANT_FLAGS(ec.value) = 0;
928930
ec.name = zend_string_init(ZEND_STRL("STDERR"), 0);
931+
ec.filename = NULL;
929932
zend_hash_del(EG(zend_constants), ec.name);
930933
zend_register_constant(&ec);
931934
}

0 commit comments

Comments
 (0)