* @return string
*/
public static function getTempFolder() {
- // This method does not contain any shut up operator by intent.
- // Any operation that fails here is fatal.
- $path = WCF_DIR.'tmp/';
-
- if (is_file($path)) {
- // wat
- unlink($path);
- }
-
- if (!file_exists($path)) {
- mkdir($path, 0777);
- }
-
- if (!is_dir($path)) {
- throw new SystemException("Temporary folder '".$path."' does not exist and could not be created. Please check the permissions of the '".WCF_DIR."' folder using your favorite ftp program.");
- }
-
- if (!is_writable($path)) {
- self::makeWritable($path);
- }
-
- if (!is_writable($path)) {
- throw new SystemException("Temporary folder '".$path."' is not writable. Please check the permissions using your favorite ftp program.");
+ try {
+ // This method does not contain any shut up operator by intent.
+ // Any operation that fails here is fatal.
+ $path = WCF_DIR.'tmp/';
+
+ if (is_file($path)) {
+ // wat
+ unlink($path);
+ }
+
+ if (!file_exists($path)) {
+ mkdir($path, 0777);
+ }
+
+ if (!is_dir($path)) {
+ throw new SystemException("Temporary folder '".$path."' does not exist and could not be created. Please check the permissions of the '".WCF_DIR."' folder using your favorite ftp program.");
+ }
+
+ if (!is_writable($path)) {
+ self::makeWritable($path);
+ }
+
+ if (!is_writable($path)) {
+ throw new SystemException("Temporary folder '".$path."' is not writable. Please check the permissions using your favorite ftp program.");
+ }
+
+ file_put_contents($path.'/.htaccess', 'deny from all');
+
+ return $path;
+ }
+ catch (SystemException $e) {
+ // use tmp folder in document root by default
+ if (!empty($_SERVER['DOCUMENT_ROOT'])) {
+ if (strpos($_SERVER['DOCUMENT_ROOT'], 'strato') !== false) {
+ // strato bugfix
+ // create tmp folder in document root automatically
+ if (!@file_exists($_SERVER['DOCUMENT_ROOT'].'/tmp')) {
+ @mkdir($_SERVER['DOCUMENT_ROOT'].'/tmp/', 0777);
+ self::makeWritable($_SERVER['DOCUMENT_ROOT'].'/tmp/');
+ }
+ }
+ if (@file_exists($_SERVER['DOCUMENT_ROOT'].'/tmp') && @is_writable($_SERVER['DOCUMENT_ROOT'].'/tmp')) {
+ return $_SERVER['DOCUMENT_ROOT'].'/tmp/';
+ }
+ }
+
+ if (isset($_ENV['TMP']) && @is_writable($_ENV['TMP'])) {
+ return $_ENV['TMP'] . '/';
+ }
+ if (isset($_ENV['TEMP']) && @is_writable($_ENV['TEMP'])) {
+ return $_ENV['TEMP'] . '/';
+ }
+ if (isset($_ENV['TMPDIR']) && @is_writable($_ENV['TMPDIR'])) {
+ return $_ENV['TMPDIR'] . '/';
+ }
+
+ if (($path = ini_get('upload_tmp_dir')) && @is_writable($path)) {
+ return $path . '/';
+ }
+ if (@file_exists('/tmp/') && @is_writable('/tmp/')) {
+ return '/tmp/';
+ }
+ if (function_exists('session_save_path') && ($path = session_save_path()) && @is_writable($path)) {
+ return $path . '/';
+ }
+
+ throw new SystemException('There is no access to the system temporary folder due to an unknown reason and no user specific temporary folder exists in '.WCF_DIR.'! This is a misconfiguration of your webserver software! Please create a folder called '.$path.' using your favorite ftp program, make it writable and then retry this installation.');
}
-
- file_put_contents($path.'/.htaccess', 'deny from all');
-
- return $path;
}
/**
<item name="wcf.acp.index.credits.contributor.more"><![CDATA[Weitere]]></item>
<item name="wcf.acp.index.innoDBWarning"><![CDATA[Die MySQL-Einstellung „innodb_flush_log_at_trx_commit“ steht auf dem Wert „1“ und verursacht dadurch eine starke Verlangsamung bestimmter Datenbankabfragen. Es wird empfohlen diesen Wert auf „2“ zu setzen.]]></item>
<item name="wcf.acp.index.inRescueMode"><![CDATA[Sie rufen diese Installation über eine abweichende Domain auf, etwa auf Grund eines Umzuges. Bitte korrigieren Sie die Einstellungen unter <a href="{link controller='ApplicationManagement'}{/link}">Anwendungen verwalten</a>.]]></item>
+ <item name="wcf.acp.index.tmpBroken"><![CDATA[Für den ordnungsgemäßen Betrieb muss das Verzeichnis „{WCF_DIR|concat:'tmp/'}“ existieren und beschreibbar sein. Bitte überprüfen Sie auch die Zugriffsrechte auf den Ordner „{'WCF_DIR'|constant}“.]]></item>
<item name="wcf.acp.index.news"><![CDATA[Nachrichten]]></item>
<item name="wcf.acp.index.setup.notice"><![CDATA[Die Installation wird in wenigen Augenblicken automatisch gestartet, bitte laden Sie diese Seite nicht neu.]]></item>
<item name="wcf.acp.index.setup.title"><![CDATA[Bitte warten]]></item>
<item name="wcf.acp.index.credits.productManager"><![CDATA[Product Manager]]></item>
<item name="wcf.acp.index.credits.trademarks"><![CDATA[“WoltLab®” and “Burning Board®” are registered Community Trade Marks at The Office of Harmonization for the Internal Market (OHIM) in Alicante, Spain.]]></item>
<item name="wcf.acp.index.credits.contributor.more"><![CDATA[More]]></item>
- <item name="wcf.acp.index.inRescueMode"><![CDATA[You are accessing this installation from an unknown domain, possibly caused by moving to a new host. Please update the settings on <a href="{link controller='ApplicationManagement'}{/link}">Manage Applications</a>.]]></item>
<item name="wcf.acp.index.innoDBWarning"><![CDATA[The MySQL configuration option “innodb_flush_log_at_trx_commit” is set to “1”, slowing down certain database queries. It is highly recommended to set it’s value to “2”.]]></item>
+ <item name="wcf.acp.index.inRescueMode"><![CDATA[You are accessing this installation from an unknown domain, possibly caused by moving to a new host. Please update the settings on <a href="{link controller='ApplicationManagement'}{/link}">Manage Applications</a>.]]></item>
+ <item name="wcf.acp.index.tmpBroken"><![CDATA[For proper operation the folder “{WCF_DIR|concat:'tmp/'}” must exist and it must be writable. Please also check the permissions of the “{'WCF_DIR'|constant}” folder.]]></item>
<item name="wcf.acp.index.news"><![CDATA[News]]></item>
<item name="wcf.acp.index.setup.notice"><![CDATA[The installation will be continued within a few moments, please do not reload this page.]]></item>
<item name="wcf.acp.index.setup.title"><![CDATA[Please Wait]]></item>