Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Feature #60524 (sys_temp_dir) #262

Closed
wants to merge 1 commit into from
Closed

Implemented Feature #60524 (sys_temp_dir) #262

wants to merge 1 commit into from

Conversation

alexkazik
Copy link

Added a new configuration directive which allows it to change the
temporary directory, the default behavior is unchanged.

This is a useful option if you use all/some hosts inside of one .ini file
with sections and want to change the temp dir per user (maybe it's not
allowed to write outside the users home directory). Since the TMPDIR
variable affects the whole php that way can not be used for this scenario.

(see https://bugs.php.net/bug.php?id=60524)

@@ -731,6 +731,10 @@ user_dir =
; On windows:
; extension_dir = "ext"

; Directory where the temporary files should be placed.
; Defaults to the system defaut (see sys_get_temp_dir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in "default"

@lstrojny
Copy link
Contributor

Nice patch. See my few remarks and we need a test for it. Could you add one?

@alexkazik
Copy link
Author

would you like a test like this?
tests/basic/req60524.phpt:
--TEST--
Req #60524 (Specify temporary directory)
--INI--
system_tmp_dir=/path/to/temp/dir
--FILE--

--EXPECT--
/path/to/temp/dir

(if yes, update my branch, right? - I'm new too this stuff)

@lstrojny
Copy link
Contributor

Yep, looks good.

{
char *system_tmp_dir = PG(system_tmp_dir);
if (system_tmp_dir) {
int len = strlen(system_tmp_dir);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declarations need to be on top of the block so that our Windows build doesn’t fail

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's okey, it at the beginning of a block

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, @laruence is right. Stupid me.

Added a new configuration directive which allows it to change the
temporary directory, the default behavior is unchanged.

This is a useful option if you use all/some hosts inside of one .ini file
with sections and want to change the temp dir per user (maybe it's not
allowed to write outside the users home directory). Since the TMPDIR
variable affects the whole php that way can not be used for this scenario.

(see https://bugs.php.net/bug.php?id=60524)
@php-pulls
Copy link

Comment on behalf of stas at php.net:

merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants