[fix] Add configuration variable for Nginx
This commit is contained in:
parent
02204a26de
commit
d2892b3139
@ -68,7 +68,7 @@ languageselection = false
|
|||||||
zerobincompatibility = false
|
zerobincompatibility = false
|
||||||
|
|
||||||
; allows you to specify the name of the web server you are using to use ParseBin.
|
; allows you to specify the name of the web server you are using to use ParseBin.
|
||||||
; If you use nginx or other webserver, delete semicolon
|
; if you use nginx or other webserver, delete semicolon
|
||||||
; webserver = "nginx"
|
; webserver = "nginx"
|
||||||
|
|
||||||
[expire]
|
[expire]
|
||||||
|
@ -52,7 +52,7 @@ class Configuration
|
|||||||
'icon' => 'identicon',
|
'icon' => 'identicon',
|
||||||
'cspheader' => 'default-src \'none\'; manifest-src \'self\'; connect-src *; script-src \'self\'; style-src \'self\'; font-src \'self\'; img-src \'self\' data:; referrer no-referrer;',
|
'cspheader' => 'default-src \'none\'; manifest-src \'self\'; connect-src *; script-src \'self\'; style-src \'self\'; font-src \'self\'; img-src \'self\' data:; referrer no-referrer;',
|
||||||
'zerobincompatibility' => false,
|
'zerobincompatibility' => false,
|
||||||
'webserver' => 'apache',
|
'webserver' => 'Apache',
|
||||||
),
|
),
|
||||||
'expire' => array(
|
'expire' => array(
|
||||||
'default' => '1week',
|
'default' => '1week',
|
||||||
|
@ -91,21 +91,21 @@ abstract class AbstractPersistence
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (property_exists($data->meta, 'webserver') && $data->meta->webserver && $this->_conf->getKey('webserver') == "Apache") {
|
if (property_exists($data->meta, 'webserver') && $data->meta->webserver && $this->_conf->getKey('webserver') == "Apache") {
|
||||||
// Create .htaccess file if it does not exist.
|
// Create .htaccess file if it does not exist.
|
||||||
$file = self::$_path . DIRECTORY_SEPARATOR . '.htaccess';
|
$file = self::$_path . DIRECTORY_SEPARATOR . '.htaccess';
|
||||||
if (!is_file($file)) {
|
if (!is_file($file)) {
|
||||||
$writtenBytes = @file_put_contents(
|
$writtenBytes = @file_put_contents(
|
||||||
$file,
|
$file,
|
||||||
'Allow from none' . PHP_EOL .
|
'Allow from none' . PHP_EOL .
|
||||||
'Deny from all' . PHP_EOL,
|
'Deny from all' . PHP_EOL,
|
||||||
LOCK_EX
|
LOCK_EX
|
||||||
);
|
);
|
||||||
if ($writtenBytes === false || $writtenBytes < 30) {
|
if ($writtenBytes === false || $writtenBytes < 30) {
|
||||||
throw new Exception('unable to write to file ' . $file, 11);
|
throw new Exception('unable to write to file ' . $file, 11);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user