Skip to content

Commit

Permalink
[VD] use tmbPath as tmp directory as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Apr 24, 2017
1 parent 4560db0 commit f47a64d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 14 deletions.
8 changes: 5 additions & 3 deletions php/elFinderVolumeBox.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -796,9 +796,6 @@ protected function init()
}
}

if (!$this->tmp && is_writable($this->options['tmbPath'])) {
$this->tmp = $this->options['tmbPath'];
}
if (!$this->tmp && ($tmp = elFinder::getStaticVar('commonTempPath'))) {
$this->tmp = $tmp;
}
Expand All @@ -821,6 +818,11 @@ protected function configure()
{
parent::configure();

// fallback of $this->tmp
if (!$this->tmp && $this->tmbPathWritable) {
$this->tmp = $this->tmbPath;
}

$this->disabled[] = 'archive';
$this->disabled[] = 'extract';
}
Expand Down
8 changes: 5 additions & 3 deletions php/elFinderVolumeDropbox2.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,6 @@ protected function init()
}
}

if (!$this->tmp && is_writable($this->options['tmbPath'])) {
$this->tmp = $this->options['tmbPath'];
}
if (!$this->tmp && ($tmp = elFinder::getStaticVar('commonTempPath'))) {
$this->tmp = $tmp;
}
Expand All @@ -560,6 +557,11 @@ protected function configure()
{
parent::configure();

// fallback of $this->tmp
if (!$this->tmp && $this->tmbPathWritable) {
$this->tmp = $this->tmbPath;
}

$this->disabled[] = 'archive';
$this->disabled[] = 'extract';

Expand Down
3 changes: 2 additions & 1 deletion php/elFinderVolumeFTP.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ protected function configure() {
$this->tmp = $tmp;
}

if (!$this->tmp && $this->tmbPath) {
// fallback of $this->tmp
if (!$this->tmp && $this->tmbPathWritable) {
$this->tmp = $this->tmbPath;
}

Expand Down
9 changes: 6 additions & 3 deletions php/elFinderVolumeGoogleDrive.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public function __construct()
'gdAlias' => '%s@GDrive',
'googleApiClient' => '',
'path' => '/',
'tmbPath' => '',
'separator' => '/',
'useGoogleTmb' => true,
'acceptedName' => '#^[^/\\?*:|"<>]*[^./\\?*:|"<>]$#',
Expand Down Expand Up @@ -976,9 +977,6 @@ protected function init()
}
}

if (!$this->tmp && is_writable($this->options['tmbPath'])) {
$this->tmp = $this->options['tmbPath'];
}
if (!$this->tmp && ($tmp = elFinder::getStaticVar('commonTempPath'))) {
$this->tmp = $tmp;
}
Expand All @@ -1005,6 +1003,11 @@ protected function configure()
{
parent::configure();

// fallback of $this->tmp
if (!$this->tmp && $this->tmbPathWritable) {
$this->tmp = $this->tmbPath;
}

$this->disabled[] = 'archive';
$this->disabled[] = 'extract';

Expand Down
1 change: 1 addition & 0 deletions php/elFinderVolumeGroup.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function __construct() {
$this->options['path'] = '/';
$this->options['dirUrlOwn'] = true;
$this->options['syncMinMs'] = 0;
$this->options['tmbPath'] = '';
$this->options['disabled'] = array(
'archive',
'cut',
Expand Down
3 changes: 2 additions & 1 deletion php/elFinderVolumeMySQL.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ protected function configure() {
$this->tmpPath = $tmp;
}

if (!$this->tmpPath && $this->tmbPath && $this->tmbPathWritable) {
// fallback of $this->tmp
if (!$this->tmpPath && $this->tmbPathWritable) {
$this->tmpPath = $this->tmbPath;
}

Expand Down
8 changes: 5 additions & 3 deletions php/elFinderVolumeOneDrive.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -747,9 +747,6 @@ protected function init()
}
}

if (!$this->tmp && is_writable($this->options['tmbPath'])) {
$this->tmp = $this->options['tmbPath'];
}
if (!$this->tmp && ($tmp = elFinder::getStaticVar('commonTempPath'))) {
$this->tmp = $tmp;
}
Expand Down Expand Up @@ -783,6 +780,11 @@ protected function configure()
{
parent::configure();

// fallback of $this->tmp
if (!$this->tmp && $this->tmbPathWritable) {
$this->tmp = $this->tmbPath;
}

$this->disabled[] = 'archive';
$this->disabled[] = 'extract';
}
Expand Down

0 comments on commit f47a64d

Please sign in to comment.