Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit f9dd3d8

Browse files
committed
Cleaned up variable names and comments
1 parent 6df570b commit f9dd3d8

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

core/src/plugins/action.compression/class.PluginCompression.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public function receiveAction($action, $httpVars, $fileVars)
4545
$currentDirPath = rtrim($currentDirPath, "/") . "/";
4646
$currentDirUrl = $userSelection->currentBaseUrl().$currentDirPath;
4747

48-
# Multi-platform function taken from stackoverflow
49-
# http://stackoverflow.com/questions/12424787/how-to-check-if-a-shell-command-exists-from-php
50-
# Check that a command exists on the system for use with shell_exec
48+
// Multi-platform function taken from stackoverflow
49+
// http://stackoverflow.com/questions/12424787/how-to-check-if-a-shell-command-exists-from-php
50+
// Check that a command exists on the system for use with shell_exec
5151
function command_exists ($command) {
5252
$whereIsCommand = (PHP_OS == 'WINNT') ? 'where' : 'which';
5353
$process = proc_open(
@@ -161,27 +161,27 @@ function command_exists ($command) {
161161
}
162162
if ($archiveFormat == ".tar.gz") {
163163
if (command_exists("pigz")) {
164-
$tarcommand = "tar -I pigz -cf ";
164+
$tarCommand = "tar -I pigz -cf ";
165165
} else {
166-
$tarcommand = "tar -czf ";
166+
$tarCommand = "tar -czf ";
167167
}
168168
} elseif ($archiveFormat == ".tar.bz2") {
169169
if (command_exists("lbzip2")) {
170-
$tarcommand = "tar -I lbzip2 -cf ";
170+
$tarCommand = "tar -I lbzip2 -cf ";
171171
} elseif (command_exists("pbzip2")) {
172-
$tarcommand = "tar -I pbzip2 -cf ";
172+
$tarCommand = "tar -I pbzip2 -cf ";
173173
} else {
174-
$tarcommand = "tar -cjf ";
174+
$tarCommand = "tar -cjf ";
175175
}
176176
} elseif ($archiveFormat == ".tar") {
177-
$tarcommand = "tar -cf ";
177+
$tarCommand = "tar -cf ";
178178
} else {
179179
file_put_contents($progressExtractFileName, "Error : " . $messages["compression.15"]);
180180
throw new AJXP_Exception($messages["compression.15"]);
181181
}
182-
$changedircommand = "cd " . AJXP_MetaStreamWrapper::getRealFSReference($currentDirUrl) . " && ";
183-
$finalcommand = $changedircommand . $tarcommand . escapeshellarg($archiveName) . " " . implode(" ", $FolderNames) . " " . implode(" ", $FileNames);
184-
shell_exec($finalcommand);
182+
$changeDirCommand = "cd " . AJXP_MetaStreamWrapper::getRealFSReference($currentDirUrl) . " && ";
183+
$compressCommand = $changeDirCommand . $tarCommand . escapeshellarg($archiveName) . " " . implode(" ", $FolderNames) . " " . implode(" ", $FileNames);
184+
shell_exec($compressCommand);
185185
} else {
186186
// If tar command is not found, compress with PHP Phar instead
187187
try {
@@ -315,25 +315,25 @@ function command_exists ($command) {
315315
if (command_exists("tar")) {
316316
if ($pathInfoCurrentAllPydioPath == "gz") {
317317
if (command_exists("pigz")) {
318-
$tarcommand = "tar -I pigz -xf ";
318+
$tarCommand = "tar -I pigz -xf ";
319319
} else {
320-
$tarcommand = "tar -xzf ";
320+
$tarCommand = "tar -xzf ";
321321
}
322322
} elseif ($pathInfoCurrentAllPydioPath == "bz2") {
323323
if (command_exists("lbzip2")) {
324-
$tarcommand = "tar -I lbzip2 -xf ";
324+
$tarCommand = "tar -I lbzip2 -xf ";
325325
} elseif (command_exists("pbzip2")) {
326-
$tarcommand = "tar -I pbzip2 -xf ";
326+
$tarCommand = "tar -I pbzip2 -xf ";
327327
} else {
328-
$tarcommand = "tar -xjf ";
328+
$tarCommand = "tar -xjf ";
329329
}
330330
} elseif ($pathInfoCurrentAllPydioPath == "tar") {
331-
$tarcommand = "tar -xf ";
331+
$tarCommand = "tar -xf ";
332332
} else {
333333
file_put_contents($progressExtractFileName, "Error : " . $messages["compression.15"]);
334334
throw new AJXP_Exception($messages["compression.15"]);
335335
}
336-
$extractCommand = $tarcommand . escapeshellarg(AJXP_MetaStreamWrapper::getRealFSReference($currentDirUrl . $fileArchive)) . " -C " . escapeshellarg(AJXP_MetaStreamWrapper::getRealFSReference($currentDirUrl . $onlyFileName));
336+
$extractCommand = $tarCommand . escapeshellarg(AJXP_MetaStreamWrapper::getRealFSReference($currentDirUrl . $fileArchive)) . " -C " . escapeshellarg(AJXP_MetaStreamWrapper::getRealFSReference($currentDirUrl . $onlyFileName));
337337
shell_exec($extractCommand);
338338
} else {
339339
// If tar command is not found, extract using PHP Phar instead

0 commit comments

Comments
 (0)