diff options
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(); |