file_handle->opened_path = expand_filepath(filename, NULL TSRMLS_CC);
- if (!(SG(options) & SAPI_OPTION_NO_CHDIR)) {
- VCWD_CHDIR_FILE(filename);
- }
SG(request_info).path_translated = filename;
file_handle->filename = SG(request_info).path_translated;
PG(during_request_startup) = 0;
- if ((primary_file->type == ZEND_HANDLE_FILENAME || primary_file->type == ZEND_HANDLE_STREAM) && primary_file->filename) {
+ if (primary_file->filename && !(SG(options) & SAPI_OPTION_NO_CHDIR)) {
#if HAVE_BROKEN_GETCWD
/* this looks nasty to me */
old_cwd_fd = open(".", 0);
PG(during_request_startup) = 0;
- if (primary_file->type == ZEND_HANDLE_FILENAME && primary_file->filename) {
+ if (primary_file->filename && !(SG(options) & SAPI_OPTION_NO_CHDIR)) {
VCWD_GETCWD(old_cwd, OLD_CWD_SIZE-1);
VCWD_CHDIR_FILE(primary_file->filename);
}
THREADS_ALLOW();
#endif
-#ifdef VIRTUAL_DIR
- /* Change virtual directory, if the feature is enabled, which is
- * (almost) a requirement for PHP in Caudium. Might want to fail if it
- * isn't. Not a problem though, since it's on by default when using ZTS
- * which we require.
- */
- VCWD_CHDIR_FILE(THIS->filename->str);
-#endif
-
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = THIS->filename->str;
file_handle.opened_path = NULL;