diff options
author | Frank Karlitschek <karlitschek@gmx.de> | 2015-09-12 22:04:41 +0200 |
---|---|---|
committer | Frank Karlitschek <karlitschek@gmx.de> | 2015-09-12 22:04:41 +0200 |
commit | 7562e4959b4726939d78720d26fdbe713c8f5c53 (patch) | |
tree | 999024c93f28183409283d51018a3a79b43efa43 /lib/base.php | |
parent | 9860a79441b8e3595450e53b6209f314c7537775 (diff) | |
parent | c3a327dc385c617bc2daf0b5a51aacfaea2abde1 (diff) | |
download | nextcloud-server-7562e4959b4726939d78720d26fdbe713c8f5c53.tar.gz nextcloud-server-7562e4959b4726939d78720d26fdbe713c8f5c53.zip |
Merge pull request #18658 from owncloud/configurable-temp
Configurable temporary directory
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/base.php b/lib/base.php index a4b5e9e01bf..5f8a7ed0f19 100644 --- a/lib/base.php +++ b/lib/base.php @@ -1115,27 +1115,16 @@ class OC { } 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(); } + } + OC::init(); |