mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-07-15 17:08:11 +00:00
usage of sendfile can be configured
This commit is contained in:
parent
28c2323744
commit
666ced5fea
|
@ -44,7 +44,13 @@ class SeedDMS_Preview_Base {
|
||||||
*/
|
*/
|
||||||
protected $timeout;
|
protected $timeout;
|
||||||
|
|
||||||
function __construct($previewDir, $timeout=5) { /* {{{ */
|
/**
|
||||||
|
* @var boolean $usesendfile use mod_sendfile if available
|
||||||
|
* @access protected
|
||||||
|
*/
|
||||||
|
protected $usesendfile;
|
||||||
|
|
||||||
|
function __construct($previewDir, $timeout=5, $usesendfile=true) { /* {{{ */
|
||||||
if(!is_dir($previewDir)) {
|
if(!is_dir($previewDir)) {
|
||||||
if (!SeedDMS_Core_File::makeDir($previewDir)) {
|
if (!SeedDMS_Core_File::makeDir($previewDir)) {
|
||||||
$this->previewDir = '';
|
$this->previewDir = '';
|
||||||
|
@ -56,6 +62,7 @@ class SeedDMS_Preview_Base {
|
||||||
}
|
}
|
||||||
$this->timeout = intval($timeout);
|
$this->timeout = intval($timeout);
|
||||||
$this->converters = array();
|
$this->converters = array();
|
||||||
|
$this->usesendfile = $usesendfile;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
static function execWithTimeout($cmd, $timeout=5) { /* {{{ */
|
static function execWithTimeout($cmd, $timeout=5) { /* {{{ */
|
||||||
|
@ -148,7 +155,7 @@ class SeedDMS_Preview_Base {
|
||||||
* @param string $filename
|
* @param string $filename
|
||||||
*/
|
*/
|
||||||
protected function sendFile($filename) { /* {{{ */
|
protected function sendFile($filename) { /* {{{ */
|
||||||
if(function_exists('apache_get_modules') && in_array('mod_xsendfile',apache_get_modules())) {
|
if($this->usesendfile && function_exists('apache_get_modules') && in_array('mod_xsendfile',apache_get_modules())) {
|
||||||
header("X-Sendfile: ".$filename);
|
header("X-Sendfile: ".$filename);
|
||||||
} else {
|
} else {
|
||||||
/* Make sure output buffering is off */
|
/* Make sure output buffering is off */
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<email>uwe@steinmann.cx</email>
|
<email>uwe@steinmann.cx</email>
|
||||||
<active>yes</active>
|
<active>yes</active>
|
||||||
</lead>
|
</lead>
|
||||||
<date>2018-03-20</date>
|
<date>2018-03-29</date>
|
||||||
<time>10:59:39</time>
|
<time>10:59:39</time>
|
||||||
<version>
|
<version>
|
||||||
<release>1.2.9</release>
|
<release>1.2.9</release>
|
||||||
|
@ -24,6 +24,7 @@
|
||||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||||
<notes>
|
<notes>
|
||||||
make sure list of converters is always an array
|
make sure list of converters is always an array
|
||||||
|
usage of mod_sendfile can be configured
|
||||||
</notes>
|
</notes>
|
||||||
<contents>
|
<contents>
|
||||||
<dir baseinstalldir="SeedDMS" name="/">
|
<dir baseinstalldir="SeedDMS" name="/">
|
||||||
|
|
Loading…
Reference in New Issue
Block a user