-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Configurable temporary directory #18658
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1108,27 +1108,16 @@ protected static function tryFormLogin() { | |
} | ||
return true; | ||
} | ||
} | ||
|
||
if (!function_exists('get_temp_dir')) { | ||
/** | ||
* Get the temporary dir to store uploaded data | ||
* @return null|string Path to the temporary directory or null | ||
*/ | ||
function get_temp_dir() { | ||
if ($temp = ini_get('upload_tmp_dir')) return $temp; | ||
if ($temp = getenv('TMP')) return $temp; | ||
if ($temp = getenv('TEMP')) return $temp; | ||
if ($temp = getenv('TMPDIR')) return $temp; | ||
$temp = tempnam(__FILE__, ''); | ||
if (file_exists($temp)) { | ||
unlink($temp); | ||
return dirname($temp); | ||
} | ||
if ($temp = sys_get_temp_dir()) return $temp; | ||
|
||
return null; | ||
return \OC::$server->getTempManager()->t_get_temp_dir(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
|
||
} | ||
|
||
|
||
OC::init(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,4 +58,12 @@ public function clean(); | |
* @since 8.0.0 | ||
*/ | ||
public function cleanOld(); | ||
|
||
/** | ||
* Get the temporary base directory | ||
* | ||
* @return string | ||
* @since 8.2.0 | ||
*/ | ||
public function getTempBaseDir(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @icewind1991 Isn't there already a public method to get a temp directory? What is the difference here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FFrom what I can tell this is the base folder we create the other folders in, I dont know if we need to expose this as public There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the public API since the original |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? I guess this can cause problems or wasn't there a reason to inclide this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ... you added it as an
\OC
method :)