[fix] Add configuration variable for Nginx

pull/223/head
magikcypress 7 years ago
parent 02204a26de
commit d2892b3139

@ -68,7 +68,7 @@ languageselection = false
zerobincompatibility = false
; 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"
[expire]

@ -52,7 +52,7 @@ class Configuration
'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;',
'zerobincompatibility' => false,
'webserver' => 'apache',
'webserver' => 'Apache',
),
'expire' => array(
'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.
$file = self::$_path . DIRECTORY_SEPARATOR . '.htaccess';
if (!is_file($file)) {
$writtenBytes = @file_put_contents(
$file,
'Allow from none' . PHP_EOL .
'Deny from all' . PHP_EOL,
LOCK_EX
);
if ($writtenBytes === false || $writtenBytes < 30) {
throw new Exception('unable to write to file ' . $file, 11);
}
$file = self::$_path . DIRECTORY_SEPARATOR . '.htaccess';
if (!is_file($file)) {
$writtenBytes = @file_put_contents(
$file,
'Allow from none' . PHP_EOL .
'Deny from all' . PHP_EOL,
LOCK_EX
);
if ($writtenBytes === false || $writtenBytes < 30) {
throw new Exception('unable to write to file ' . $file, 11);
}
}
}
}
}
/**

Loading…
Cancel
Save